diff --git a/CHANGES b/CHANGES
index 533c0ae..781a854 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
-0.49.1 2014-11-16
-        - Major refactoring for new response messages (diewald)
+0.49.1 2014-11-25
+        - [cleanup] Major refactoring for new response messages (diewald)
+	- [cleanup] Removed deprecated error messaging (diewald)
+	- [documentation] Improved documentation for notifications (diewald)
 
 0.49 2014-11-14
         - This is a major version (prepared for the Evaluation Meeting)
diff --git a/pom.xml b/pom.xml
index e0742e1..9dc1e35 100644
--- a/pom.xml
+++ b/pom.xml
@@ -14,14 +14,6 @@
       $mvn clean compile exec:java
   -->
 
-  <!--
-      <parent>
-      <groupId>KorAP-modules</groupId>
-      <artifactId>KorAP-core-modules</artifactId>
-      <version>LATEST</version>
-      </parent>
-  -->
-
   <groupId>KorAP-modules</groupId>
   <artifactId>KorAP-lucene-index</artifactId>
   <version>0.49.1</version>
@@ -41,12 +33,10 @@
       <email>diewald@ids-mannheim.de</email>
       <url>http://nils-diewald.de</url>
     </developer>
-
     <developer>
       <name>Eliza Margaretha</name>
       <email>margaretha@ids-mannheim.de</email>
     </developer>
-
   </developers>
 
   <properties>
@@ -151,13 +141,13 @@
       <version>1.13-b01</version>
     </dependency>
 
-    <!-- JSON support -->
+    <!-- JSON support in Jersey -->
     <dependency>
       <groupId>org.glassfish.jersey.media</groupId>
       <artifactId>jersey-media-moxy</artifactId>
     </dependency>
 
-    <!-- Jackson -->
+    <!-- JSON support using Jackson -->
     <!-- see https://github.com/FasterXML/jackson-core -->
     <!-- https://github.com/FasterXML/jackson-databind -->
     <dependency>
@@ -239,6 +229,26 @@
         </configuration>
       </plugin> 
 
+      <!-- Formatter plugin for Eclipse based coding conventions -->
+      <!--
+	  http://maven-java-formatter-plugin.googlecode.com/svn/site/0.4/usage.html
+	  Call: mvn java-formatter:format
+      -->
+      <plugin>
+        <groupId>com.googlecode.maven-java-formatter-plugin</groupId>
+        <artifactId>maven-java-formatter-plugin</artifactId>
+        <version>0.4</version>
+	<!--
+	<executions>
+          <execution>
+            <goals>
+              <goal>format</goal>
+            </goals>
+          </execution>
+        </executions>
+	-->
+      </plugin>
+
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
diff --git a/src/main/java/de/ids_mannheim/korap/KorapResult.java b/src/main/java/de/ids_mannheim/korap/KorapResult.java
index 9b00870..9ac2aef 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapResult.java
@@ -50,7 +50,6 @@
 
     private JsonNode request;
 
-    private boolean timeExceeded = false;
 
     // Logger
     // This is KorapMatch instead of KorapResult!
@@ -176,16 +175,6 @@
 	return this.itemsPerResource;
     };
 
-    public void setTimeExceeded (boolean timeout) {
-	if (timeout)
-	    this.addWarning(682, "Search time exceeded");
-	this.timeExceeded = timeout;
-    };
-
-    public boolean getTimeExceeded () {
-	return this.timeExceeded;
-    };
-
     public String getQuery () {
         return this.query;
     };
@@ -249,9 +238,6 @@
 
 	json.put("totalResults", this.getTotalResults());
 
-	if (this.timeExceeded)
-	    json.put("timeExceeded", this.timeExceeded);
-
 	// Add matches
 	if (this.matches != null)
 	    json.putPOJO("matches", this.getMatches());
diff --git a/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java b/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
index 6f43e32..40a75aa 100644
--- a/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
+++ b/src/main/java/de/ids_mannheim/korap/response/KorapResponse.java
@@ -9,23 +9,41 @@
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import de.ids_mannheim.korap.response.Notifications;
 
+/**
+ * Base class for objects meant to be responded by the server.
+ *
+ * <p>
+ * <blockquote><pre>
+ *   KorapResponse km = new KorapResponse();
+ *   System.out.println(
+ *     km.toJSON()
+ *   );
+ * </pre></blockquote>
+ *
+ * @author Nils Diewald
+ * @see de.ids_mannheim.korap.response.Notifications
+ */
 public class KorapResponse extends Notifications {
     ObjectMapper mapper = new ObjectMapper();
 
-    private String
-	version,
-	name,
-	node,
-	listener;
+    // TODO: Add timeout!!!
+
+    private String version, name, node, listener;
     private String benchmark;
+    private boolean timeExceeded = false;
 
-    // add timeout!!!
-    // remove totalResults, totalTexts
 
+    /**
+     * Construct a new KorapResponse object.
+     *
+     * @return The new KorapResponse object
+     */
     public KorapResponse () {};
 
     /**
-     * Get version of the index
+     * Get string representation of the backend's version.
+     *
+     * @return String representation of the backend's version
      */
     @JsonIgnore
     public String getVersion () {
@@ -35,18 +53,22 @@
     };
 
     /**
-     * Set version number.
+     * Set the string representation of the backend's version.
      *
-     * @param version The version number of the index as
-     *                a string representation.
+     * @param version The string representation of the backend's version
+     * @return KorapResponse object for chaining
      */
     @JsonIgnore
-    public void setVersion (String version) {
+    public KorapResponse setVersion (String version) {
 	this.version = version;
+	return this;
     };
 
     /**
-     * Get name the index
+     * Get string representation of the backend's name.
+     * All nodes in a cluster should have the same backend name.
+     *
+     * @return String representation of the backend's name
      */
     @JsonIgnore
     public String getName () {
@@ -56,27 +78,57 @@
     };
 
     /**
-     * Set name.
+     * Set the string representation of the backend's name.
+     * All nodes in a cluster should have the same backend name.
      *
-     * @param name The name of the index as
-     *             a string representation.
+     * @param version The string representation of the backend's name
+     * @return KorapResponse object for chaining
      */
     @JsonIgnore
-    public void setName (String name) {
+    public KorapResponse setName (String name) {
 	this.name = name;
+	return this;
     };
 
+    /**
+     * Get string representation of the node's name.
+     * Each node in a cluster has a unique name.
+     *
+     * @return String representation of the node's name
+     */
     @JsonIgnore
     public String getNode () {
 	return this.node;
     };
 
+    /**
+     * Set the string representation of the node's name.
+     * Each node in a cluster has a unique name.
+     *
+     * @param version The string representation of the node's name
+     * @return KorapResponse object for chaining
+     */
     @JsonIgnore
     public KorapResponse setNode (String name) {
 	this.node = name;
 	return this;
     };
 
+
+    @JsonIgnore
+    public void setTimeExceeded (boolean timeout) {
+	if (timeout)
+	    this.addWarning(682, "Search time exceeded");
+	this.timeExceeded = timeout;
+    };
+
+
+    @JsonIgnore
+    public boolean getTimeExceeded () {
+	return this.timeExceeded;
+    };
+
+
     @JsonIgnore
     public KorapResponse setBenchmark (long t1, long t2) {
         this.benchmark =
@@ -130,6 +182,9 @@
 	    sb.append(this.getVersion());
 	};
 
+	if (this.timeExceeded)
+	    json.put("timeExceeded", true);
+
 	if (sb.length() > 0)
 	    json.put("version", sb.toString());
 
diff --git a/src/main/java/de/ids_mannheim/korap/response/Message.java b/src/main/java/de/ids_mannheim/korap/response/Message.java
index 4f7cd29..1fb1709 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Message.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Message.java
@@ -7,6 +7,20 @@
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.*;
 
+/**
+ * A message for Notifications.
+ *
+ * <p>
+ * <blockquote><pre>
+ *   Message m = new Message();
+ *   m.setCode(614);
+ *   m.setMessage("This is a new message");
+ *   m.addParameter("MyClass");
+ * </pre></blockquote>
+ *
+ * @author Nils Diewald
+ * @see de.ids_mannheim.korap.response.Messages
+ */
 public class Message implements Cloneable {
     // Mapper for JSON serialization
     ObjectMapper mapper = new ObjectMapper();
@@ -15,47 +29,99 @@
     private int code = 0;
     private LinkedList<String> parameters;
 
+    /**
+     * Construct a new message object.
+     *
+     * @param code Code number representing the message code
+     * @param msg String representation of the message
+     * @return The new message object
+     */
     public Message (int code, String msg) {
 	this.code = code;
 	this.msg  = msg;
     };
 
+    /**
+     * Construct a new message object.
+     *
+     * @return The new empty message object
+     */
     public Message () {};
 
+    /**
+     * Set the string representation of the message.
+     *
+     * @param msg String representation of the message
+     * @return Message object for chaining
+     */
     @JsonIgnore
-    public void setMessage (String msg) {
+    public Message setMessage (String msg) {
 	this.msg = msg;
+	return this;
     };
 
+    /**
+     * Return the string representation of the message.
+     *
+     * @return String representation of the message
+     */
     @JsonIgnore
     public String getMessage () {
 	return this.msg;
     };
 
+    /**
+     * Set the integer representation of the message.
+     *
+     * @param code Integer code representation of the message
+     * @return Message object for chaining
+     */
     @JsonIgnore
-    public void setCode (int code) {
+    public Message setCode (int code) {
 	this.code = code;
+	return this;
     };
 
+    /**
+     * Return the integer code representation of the message.
+     *
+     * @return Integer code representation of the message
+     */
     @JsonIgnore
     public int getCode () {
 	return this.code;
     };
 
-    public void addParameter (String param) {
+
+    /**
+     * Add additional string parameters to the message.
+     *
+     * @return Message object for chaining
+     */
+    public Message addParameter (String param) {
 	if (this.parameters == null)
 	    this.parameters = new LinkedList<String>();
 	this.parameters.add(param);
+	return this;
     };
 
-    public Object clone () throws CloneNotSupportedException
-    {
+    /**
+     * Create a clone of the Message.
+     *
+     * @return The cloned message object 
+     * @throws CloneNotSupportedException if message can't be cloned
+     */
+    public Object clone () throws CloneNotSupportedException {
 	Message clone = new Message();
+
+	// Copy message string
 	if (this.msg != null)
 	    clone.msg = this.msg;
 
+	// Copy message code
 	clone.code = this.code;
 
+	// Copy parameters
 	if (this.parameters != null) {
 	    for (String p : this.parameters) {
 		clone.addParameter(p);
@@ -65,7 +131,11 @@
 	return clone;
     };
 
-    
+    /**
+     * Serialize Message as a JsonNode.
+     *
+     * @return JsonNode representation of the message
+     */
     public JsonNode toJSONnode () {
 	ArrayNode message = mapper.createArrayNode();
 
@@ -79,8 +149,15 @@
 	return (JsonNode) message;
     };
 
+
     /**
-     * Get JSON string
+     * Serialize Message as a JSON string.
+     * <p>
+     * <blockquote><pre>
+     * [123, "You are not allowed to serialize these messages"]
+     * </pre></blockquote>
+     *
+     * @return String representation of the message
      */
     public String toJSON () {
 	String msg = "";
@@ -88,9 +165,9 @@
 	    return mapper.writeValueAsString(this.toJSONnode());
 	}
 	catch (Exception e) {
+	    // Bad in case the message contains quotes!
 	    msg = ", \"" + e.getLocalizedMessage() + "\"";
 	};
-
 	return
 	    "[620, " +
 	    "\"Unable to generate JSON\"" + msg + "]";
diff --git a/src/main/java/de/ids_mannheim/korap/response/Messages.java b/src/main/java/de/ids_mannheim/korap/response/Messages.java
index 1af8614..2239842 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Messages.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Messages.java
@@ -8,26 +8,78 @@
 import com.fasterxml.jackson.databind.JsonNode;
 import com.fasterxml.jackson.databind.node.*;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.lang.*;
+import java.util.*;
 
 /**
- * @author Nils Diewald
+ * A list of messages for Notifications.
  *
- * An array of messages.
+ * <p>
+ * <blockquote><pre>
+ *   Messages m = new Messages();
+ *   m.add(614, "This is a new message");
+ * </pre></blockquote>
+ *
+ * @author Nils Diewald
+ * @see de.ids_mannheim.korap.response.Notifications
+ * @see de.ids_mannheim.korap.response.Message
  */
-public class Messages implements Cloneable {
+public class Messages implements Cloneable, Iterable<Message> {
 
-    // Mapper for JSON serialization
+    // Create object mapper for JSON generation
     ObjectMapper mapper = new ObjectMapper();
+
+    // List of messages
     private ArrayList<Message> messages;
 
+    // Private class for iterator implementation
+    private class MessageIterator implements Iterator<Message> {
+	int index;
+
+	// Constructor
+        public MessageIterator () {
+            this.index = 0;
+        };
+
+        @Override
+	public boolean hasNext () {
+            return this.index < messages.size();
+        };
+
+        @Override
+	public Message next () {
+            return messages.get(this.index++);
+        };
+
+        @Override
+        public void remove () {
+	    messages.remove(this.index);
+        };
+    };
+
+    /**
+     * Construct a new Messages object.
+     */
     public Messages () {
 	this.messages = new ArrayList<Message>(3);
     };
 
     /**
-     * Add message
+     * Get the iterator object.
+     *
+     * @return Iterator for Message object.
+     */
+    public Iterator<Message> iterator() {
+        return new MessageIterator();
+    };
+
+    /**
+     * Append a new message.
+     *
+     * @param code  Integer code representation of the warning
+     * @param msg   String representation of the warning
+     * @param terms Optional strings of additional information
+     * @return New Message object
      */
     public Message add (int code,
 			String message,
@@ -41,15 +93,28 @@
     };
 
     /**
-     * Add message
+     * Append an existing message.
+     *
+     * @param msg Message object to be added. Message will be cloned.
+     * @return Cloned Message object
      */
     public Message add (Message msg) {
-	messages.add(msg);
-	return msg;
+	try {
+	    Message msgClone = (Message) msg.clone();
+	    messages.add(msgClone);
+	    return msgClone;
+	}
+	catch (CloneNotSupportedException e) {
+	};
+	return (Message) null;
     };
 
     /**
-     * Add message usng JsonNode
+     * Append an existing message comming from a JsonNode.
+     *
+     * @param node  <code>JsonNode</code> representing a message
+     * @return New Message object
+     * @throws QueryException if notification is not well formed (Error 750)
      */
     public Message add (JsonNode msg) throws QueryException {
 	if (!msg.isArray() || !msg.has(0))
@@ -84,37 +149,72 @@
 
 
     /**
-     * Add messages
+     * Append existing messages.
+     *
+     * @param msgs Messages object to be added. Messages will be cloned.
+     * @return Messages object for chaining.
      */
-    public void add (Messages msgs) {
-	for (Message msg : msgs.getMessages()) {
-	    this.add(msg);
+    public Messages add (Messages msgs) {
+	try {
+	    for (Message msg : msgs.getMessages())
+		this.add((Message) msg.clone());
+	}
+	catch (CloneNotSupportedException e) {
 	};
+	return this;
     };
 
     /**
-     * Clear all messages
+     * Clear all messages.
+     *
+     * @return Messages object for chaining
      */
-    public void clear () {
-	messages.clear();
+    public Messages clear () {
+	this.messages.clear();
+	return this;
     };
 
+    /**
+     * Get the number of the messages.
+     *
+     * @param Integer representing the number of messages in the list.
+     */
     public int size () {
 	return this.messages.size();
     };
 
+
+    /**
+     * Return a specific message based on an index.
+     *
+     * @param index The index of the message in the list of messages.
+     * @return The message in case it exists, otherwise <code>null</code>
+     */
     @JsonIgnore
     public Message get (int index) {
+	if (index >= this.size())
+	    return (Message) null;
 	return this.messages.get(index);
     };
 
+    /**
+     * Return all messages.
+     *
+     * @return List of all Message objects
+     */
     @JsonIgnore
     public List<Message> getMessages () {
 	return this.messages;
     };
 
-    public Object clone () throws CloneNotSupportedException
-    {
+
+    /**
+     * Create a clone of the Messages.
+     *
+     * @return The cloned messages object 
+     * @throws CloneNotSupportedException if messages can't be cloned
+     */
+    public Object clone () throws CloneNotSupportedException {
 	Messages clone = new Messages();
 	for (Message m : this.messages) {
 	    clone.add((Message) m.clone());
@@ -124,7 +224,9 @@
     };
 
     /**
-     * Get JSON node
+     * Serialize Messages as a JsonNode.
+     *
+     * @return JsonNode representation of all messages
      */
     public JsonNode toJSONnode () {
 	ArrayNode messageArray = mapper.createArrayNode();
@@ -133,8 +235,18 @@
 	return (JsonNode) messageArray;
     };
 
+
     /**
-     * Get JSON string
+     * Serialize Messages as a JSON string.
+     * <p>
+     * <blockquote><pre>
+     * [
+     *   [123, "You are not allowed to serialize these messages"],
+     *   [124, "Your request was invalid"]
+     * ]
+     * </pre></blockquote>
+     *
+     * @return String representation of all messages
      */
     public String toJSON () {
 	String msg = "";
@@ -142,6 +254,7 @@
 	    return mapper.writeValueAsString(this.toJSONnode());
 	}
 	catch (Exception e) {
+	    // Bad in case the message contains quotes!
 	    msg = ", \"" + e.getLocalizedMessage() + "\"";
 	};
 
diff --git a/src/main/java/de/ids_mannheim/korap/response/Notifications.java b/src/main/java/de/ids_mannheim/korap/response/Notifications.java
index 361fb9a..4b985f7 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Notifications.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Notifications.java
@@ -13,12 +13,31 @@
 import de.ids_mannheim.korap.util.QueryException;
 
 /**
- * Unified notification class for KorAP related errors,
+ * A unified notification class for KorAP related errors,
  * warnings and messages.
  *
+ * <p>
+ * The object contains lists of errors, warnings and messages
+ * and new warnings, errors or messages are appended to these lists.
+ *
+ * <p>
+ * <blockquote><pre>
+ *   Notifications n = new Notifications();
+ *   n.addWarning(456, "Something went wrong");
+ *   if (n.hasWarnings()) {
+ *     for (Message msg : n.getWarnings())
+ *       System.err.out(msg.getCode() + ": " + msg.getMessage());
+ *   };
+ *   System.err.println(n.toJSON());
+ * </pre></blockquote>
+ *
  * @author Nils Diewald
+ * @see de.ids_mannheim.korap.response.Messages
  */
-
+/*
+ * This will be inherited most of the time as Java does not support roles
+ * and I have no idea how to do this more elegantly.
+ */
 @JsonInclude(Include.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
 public class Notifications {
@@ -31,50 +50,70 @@
 	             messages;
 
     /**
-     * Add a new warning.
+     * Appends a new warning.
      *
-     * @param code Integer code representation of the warning
-     * @param msg String representation of the warning
+     * @param code  Integer code representation of the warning
+     * @param msg   String representation of the warning
+     * @param terms Optional strings of additional information
+     * @return Notification object for chaining
      */
-    public void addWarning (int code, String msg, String ... terms) {
+    public Notifications addWarning (int code, String msg, String ... terms) {
 	if (this.warnings == null)
 	    this.warnings = new Messages();
 	this.warnings.add(code, msg, terms);
+	return this;
     };
 
-    public void addWarning (JsonNode msg) {
+    /**
+     * Appends a new warning.
+     *
+     * @param node  <code>JsonNode</code> representing a warning message
+     * @return Notification object for chaining
+     */
+    public Notifications addWarning (JsonNode node) {
 	if (this.warnings == null)
 	    this.warnings = new Messages();
 
 	try {
-	    this.warnings.add(msg);
+	    this.warnings.add(node);
 	}
 	catch (QueryException qe) {
 	    this.warnings.add(qe.getErrorCode(), qe.getMessage());
 	};
+
+	return this;
     };
 
     /**
-     * Add new warnings.
+     * Appends new warnings.
      *
-     * @param msgs Array representation of the warning
+     * @param msgs  <code>Messages</code> representing multiple warnings
+     * @return Notification object for chaining
      */
-    public void addWarnings (Messages msgs) {
+    public Notifications addWarnings (Messages msgs) {
 	if (this.warnings == null)
 	    this.warnings = msgs;
 	else
 	    this.warnings.add(msgs);
+	return this;
     };
 
 
     /**
-     * Get all warnings.
+     * Return all warnings.
+     *
+     * @return The <code>Messages</code> object representing all warnings
      */
     public Messages getWarnings () {
 	return this.warnings;
     };
 
-
+    /**
+     * Return a specific warning based on an index.
+     *
+     * @param index The index of the warning in the list of warnings.
+     * @return The message in case it exists, otherwise <code>null</code>
+     */
     public Message getWarning (int index) {
 	if (this.warnings != null)
 	    return this.warnings.get(index);
@@ -84,6 +123,8 @@
 
     /**
      * Check for warnings.
+     *
+     * @return <tt>true</tt> in case there are warnings, otherwise <tt>false</tt>
      */
     public boolean hasWarnings () {
 	if (this.warnings == null || this.warnings.size() == 0)
@@ -92,18 +133,27 @@
     };
 
     /**
-     * Add a new error.
+     * Appends a new error.
      *
-     * @param code Integer code representation of the error
-     * @param msg String representation of the error
+     * @param code  Integer code representation of the error
+     * @param msg   String representation of the error
+     * @param terms Optional strings of additional information
+     * @return Notification object for chaining
      */
-    public void addError (int code, String msg, String ... terms) {
+    public Notifications addError (int code, String msg, String ... terms) {
 	if (this.errors == null)
 	    this.errors = new Messages();
 	this.errors.add(code, msg, terms);
+	return this;
     };
 
-    public void addError (JsonNode msg) {
+    /**
+     * Appends a new error.
+     *
+     * @param node  <code>JsonNode</code> representing an error message
+     * @return Notification object for chaining
+     */
+    public Notifications addError (JsonNode msg) {
 	if (this.errors == null)
 	    this.errors = new Messages();
 	try {
@@ -112,37 +162,54 @@
 	catch (QueryException qe) {
 	    this.errors.add(qe.getErrorCode(), qe.getMessage());
 	};
+
+	return this;
     };
 
 
     /**
-     * Add new warnings.
+     * Appends new errors.
      *
-     * @param msgs Array representation of the warning
+     * @param msgs  <code>Messages</code> representing multiple errors
+     * @return Notification object for chaining
      */
-    public void addErrors (Messages msgs) {
+    public Notifications addErrors (Messages msgs) {
 	if (this.errors == null)
 	    this.errors = msgs;
 	else
 	    this.errors.add(msgs);
+	return this;
     };
 
 
+
     /**
-     * Get all errors.
+     * Return all errors.
+     *
+     * @return The <code>Messages</code> object representing all errors
      */
     public Messages getErrors () {
 	return this.errors;
     };
 
+
+    /**
+     * Return a specific error based on an index.
+     *
+     * @param index The index of the error in the list of errors.
+     * @return The message in case it exists, otherwise <code>null</code>
+     */
     public Message getError (int index) {
 	if (this.errors != null)
 	    return this.errors.get(index);
 	return (Message) null;
     };
 
+
     /**
      * Check for errors.
+     *
+     * @return <tt>true</tt> in case there are errors, otherwise <tt>false</tt>
      */
     public boolean hasErrors () {
 	if (this.errors == null || this.errors.size() == 0)
@@ -152,18 +219,27 @@
 
 
     /**
-     * Add a new message.
+     * Appends a new message.
      *
-     * @param code Integer code representation of the message
-     * @param msg String representation of the message
+     * @param code  Integer code representation of the message
+     * @param msg   String representation of the message
+     * @param terms Optional strings of additional information
+     * @return Notification object for chaining
      */
-    public void addMessage (int code, String msg, String ... terms) {
+    public Notifications addMessage (int code, String msg, String ... terms) {
 	if (this.messages == null)
 	    this.messages = new Messages();
 	this.messages.add(code, msg, terms);
+	return this;
     };
 
-    public void addMessage (JsonNode msg) {
+    /**
+     * Appends a new message.
+     *
+     * @param node  <code>JsonNode</code> representing a message
+     * @return Notification object for chaining
+     */
+    public Notifications addMessage (JsonNode msg) {
 	if (this.messages == null)
 	    this.messages = new Messages();
 	try {
@@ -172,28 +248,40 @@
 	catch (QueryException qe) {
 	    this.messages.add(qe.getErrorCode(), qe.getMessage());
 	};
+	return this;
     };
 
+
     /**
-     * Add new warnings.
+     * Appends new messages.
      *
-     * @param msgs Array representation of the warning
+     * @param msgs  <code>Messages</code> representing multiple messages
+     * @return Notification object for chaining
      */
-    public void addMessages (Messages msgs) {
+    public Notifications addMessages (Messages msgs) {
 	if (this.messages == null)
 	    this.messages = msgs;
 	else
 	    this.messages.add(msgs);
+	return this;
     };
 
 
     /**
-     * Get all messages.
+     * Return all messages.
+     *
+     * @return The <code>Messages</code> object representing all messages
      */
     public Messages getMessages () {
 	return this.messages;
     };
 
+    /**
+     * Return a specific message based on an index.
+     *
+     * @param index The index of the message in the list of messages.
+     * @return The message in case it exists, otherwise <code>null</code>
+     */
     public Message getMessage (int index) {
 	if (this.messages != null)
 	    return this.messages.get(index);
@@ -203,6 +291,8 @@
 
     /**
      * Check for messages.
+     *
+     * @return <tt>true</tt> in case there are messages, otherwise <tt>false</tt>
      */
     public boolean hasMessages () {
 	if (this.messages == null || this.messages.size() == 0)
@@ -212,9 +302,12 @@
 
 
     /**
-     * Copy notifications
+     * Copy notifications from one notification object.
+     *
+     * @param notes Notification object to copy notifications from.
+     * @return Notification object for chaining
      */
-    public void copyNotificationsFrom (Notifications notes) {
+    public Notifications copyNotificationsFrom (Notifications notes) {
 	try {
 	    if (notes.hasErrors())
 		this.addErrors((Messages) notes.getErrors().clone());
@@ -225,14 +318,17 @@
 	}
 	catch (CloneNotSupportedException cnse) {
 	};
-	return;
+	return this;
     };
 
 
     /**
-     * Copy notifications from JsonNode
+     * Copy notifications from a JsonNode object.
+     *
+     * @param request Notifications containing JsonNode.
+     * @return Notification object for chaining
      */
-    public void copyNotificationsFrom (JsonNode request) {
+    public Notifications copyNotificationsFrom (JsonNode request) {
 
 	// Add warnings from JSON
 	if (request.has("warnings") &&
@@ -259,11 +355,15 @@
 		for (JsonNode msg : msgs)
 		    this.addError(msg);
 	};
+
+	return this;
     };
 
 
     /**
-     * Serialize response to JSON node.
+     * Serialize Notifications as a JsonNode.
+     *
+     * @return JsonNode representation of all warnings, errors, and messages
      */
     public JsonNode toJSONnode () {
 	ObjectNode json =  mapper.createObjectNode();
@@ -280,7 +380,21 @@
     };
 
     /**
-     * Serialize response to JSON string.
+     * Serialize Notifications as a JSON string.
+     * <p>
+     * <blockquote><pre>
+     * {
+     *   "errors": [
+     *     [123, "You are not allowed to serialize these messages"],
+     *     [124, "Your request was invalid"]
+     *   ],
+     *   "messages" : [
+     *     [125, "Class is deprecated", "Notifications"]
+     *   ]
+     * }
+     * </pre></blockquote>
+     *
+     * @return String representation of all warnings, errors, and messages
      */
     public String toJSON () {
 	String msg = "";
@@ -291,6 +405,7 @@
 	    return mapper.writeValueAsString(node);
 	}
 	catch (Exception e) {
+	    // Bad in case the message contains quotes!
 	    msg = ", \"" + e.getLocalizedMessage() + "\"";
 	};
 
@@ -303,60 +418,16 @@
 
     /**
      * Clear all notifications.
+     *
+     * @return Notification object for chaining
      */
-    public void clearNotifications () {
+    public Notifications clearNotifications () {
 	if (this.warnings != null)
 	    this.warnings.clear();
 	if (this.messages != null)
 	    this.messages.clear();
 	if (this.errors != null)
 	    this.errors.clear();
-    };
-
-
-    // Remove:
-    @Deprecated
-    public void addError (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void addWarning (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void addMessage (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setError (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setWarning (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setMessage (String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setError (int code, String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setWarning (int code, String msg) {
-	System.err.println("DEPRECATED " + msg);
-    };
-
-    @Deprecated
-    public void setMessage (int code, String msg) {
-	System.err.println("DEPRECATED " + msg);
+	return this;
     };
 };
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestMessage.java b/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
index 6ecdf73..440e027 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestMessage.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.response;
 
+import de.ids_mannheim.korap.response.Message;
 import de.ids_mannheim.korap.response.Messages;
 
 import static org.junit.Assert.*;
@@ -36,4 +37,17 @@
 	km.add(614,"Test");
 	assertEquals("[[612,\"Foo\"],[613,\"Bar\",\"Instanz\"],[614,\"Test\"]]", km.toJSON());
     };
+
+    @Test
+    public void CheckIterability () {
+	Messages km = new Messages();
+	km.add(612,"Foo");
+	km.add(613,"Bar", "Instanz");
+	km.add(614,"Test");
+	String test = "";
+	for (Message msg : km)
+	    test += msg.getCode();
+
+	assertEquals(test, "612613614");
+    };
 };
