diff --git a/src/main/java/de/ids_mannheim/korap/response/Response.java b/src/main/java/de/ids_mannheim/korap/response/Response.java
index 674cd0b..d5846fb 100644
--- a/src/main/java/de/ids_mannheim/korap/response/Response.java
+++ b/src/main/java/de/ids_mannheim/korap/response/Response.java
@@ -49,6 +49,8 @@
     private String benchmark;
     private boolean timeExceeded = false;
 
+    private static final String KORAL_VERSION =
+        "http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld";
 
     /**
      * Construct a new Response object.
@@ -451,6 +453,8 @@
         // Get notifications json response
         ObjectNode json = (ObjectNode) super.toJsonNode();
 
+        json.put("@context", KORAL_VERSION);
+
         StringBuilder sb = new StringBuilder();
         if (this.getName() != null) {
             sb.append(this.getName());
diff --git a/src/main/java/de/ids_mannheim/korap/server/Resource.java b/src/main/java/de/ids_mannheim/korap/server/Resource.java
index 7f9e99b..bb047a5 100644
--- a/src/main/java/de/ids_mannheim/korap/server/Resource.java
+++ b/src/main/java/de/ids_mannheim/korap/server/Resource.java
@@ -76,20 +76,12 @@
     @GET
     @Produces(MediaType.APPLICATION_JSON)
     public String info () {
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-        kresp.setListener(Node.getListener());
+        Response kresp = _initResponse();
 
-        // Get index
-        KrillIndex index = Node.getIndex();
-        kresp.setName(index.getName());
-        kresp.setVersion(index.getVersion());
-        /*
-        kresp.addMessage(
-          "Number of documents in the index",
-          String.parseLong(index.numberOf("documents"))
-        );
-        */
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
+
+        // TODO: Name the number of documents in the index
         kresp.addMessage(680, "Server is up and running!");
         return kresp.toJsonString();
     };
@@ -104,7 +96,7 @@
      */
     /*
      * Support GZip:
-     * oR MAYBE IT'S ALREADY SUPPORTED ....
+     * Or maybe it's already supported ...
      * http://stackoverflow.com/questions/19765582/how-to-make-jersey-use-gzip-compression-for-the-response-message-body
     */
     @PUT
@@ -122,20 +114,13 @@
         if (DEBUG)
             log.trace("Added new document with unique identifier {}", uid);
 
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
+
         // Get index
         KrillIndex index = Node.getIndex();
 
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-
-        if (index == null) {
-            kresp.addError(601, "Unable to find index");
-            return kresp.toJsonString();
-        };
-
-        kresp.setVersion(index.getVersion());
-        kresp.setName(index.getName());
-
         FieldDocument fd = index.addDoc(uid, json);
         if (fd == null) {
             // Set HTTP to ???
@@ -165,18 +150,12 @@
     @Produces(MediaType.APPLICATION_JSON)
     public String commit () {
 
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
+
         // Get index
         KrillIndex index = Node.getIndex();
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-
-        if (index == null) {
-            kresp.addError(601, "Unable to find index");
-            return kresp.toJsonString();
-        };
-
-        kresp.setVersion(index.getVersion());
-        kresp.setName(index.getName());
 
         // There are documents to commit
         try {
@@ -206,48 +185,37 @@
     @Consumes(MediaType.APPLICATION_JSON)
     public String find (String json, @Context UriInfo uri) {
 
-        // Get index
-        KrillIndex index = Node.getIndex();
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
 
         // Search index
-        if (index != null) {
-            Krill ks = new Krill(json);
+        Krill ks = new Krill(json);
 
-            // Get query parameters
-            MultivaluedMap<String, String> qp = uri.getQueryParameters();
+        // Get query parameters
+        MultivaluedMap<String, String> qp = uri.getQueryParameters();
 
-            if (qp.get("uid") != null) {
-
-                // Build Collection based on a list of uids
-                List<String> uids = qp.get("uid");
-                KrillCollection kc = new KrillCollection();
-                kc.filterUIDs(uids.toArray(new String[uids.size()]));
-
-                // TODO: RESTRICT COLLECTION TO ONLY RESPECT SELF DOCS (REPLICATION)
-
-                // Override old collection
-                ks.setCollection(kc);
-
-                // Only return the first match per text
-                ks.getMeta().setItemsPerResource(1);
-
-                return ks.apply(index).toJsonString();
-            };
-            Result kr = new Result();
-            kr.setNode(Node.getName());
-            kr.addError(610, "Missing request parameters",
-                    "No unique IDs were given");
-            return kr.toJsonString();
+        if (qp.get("uid") == null) {
+            kresp.addError(610,
+                           "Missing request parameters",
+                           "No unique IDs were given");
+            return kresp.toJsonString();
         };
 
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-        kresp.setName(index.getName());
-        kresp.setVersion(index.getVersion());
+        // Build Collection based on a list of uids
+        List<String> uids = qp.get("uid");
+        KrillCollection kc = new KrillCollection();
+        kc.filterUIDs(uids.toArray(new String[uids.size()]));
 
-        kresp.addError(601, "Unable to find index");
+        // TODO: RESTRICT COLLECTION TO ONLY RESPECT SELF DOCS (REPLICATION)
 
-        return kresp.toJsonString();
+        // Override old collection
+        ks.setCollection(kc);
+
+        // Only return the first match per text
+        ks.getMeta().setItemsPerResource(1);
+
+        return ks.apply(Node.getIndex()).toJsonString();
     };
 
 
@@ -264,16 +232,9 @@
     public String collect (String json, @PathParam("resultID") String resultID,
             @Context UriInfo uri) {
 
-        // Get index
-        KrillIndex index = Node.getIndex();
-
-        // No index found
-        if (index == null) {
-            Response kresp = new Response();
-            kresp.setNode(Node.getName());
-            kresp.addError(601, "Unable to find index");
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
             return kresp.toJsonString();
-        };
 
         // Get the database
         try {
@@ -284,7 +245,8 @@
             // TODO: Only search in self documents (REPLICATION FTW!)
 
             Krill ks = new Krill(json);
-            MatchCollector result = index.collect(ks, mc);
+            // TODO: Reuse response!
+            MatchCollector result = Node.getIndex().collect(ks, mc);
 
             result.setNode(Node.getName());
             return result.toJsonString();
@@ -293,11 +255,6 @@
             log.error(e.getLocalizedMessage());
         };
 
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-        kresp.setName(index.getName());
-        kresp.setVersion(index.getVersion());
-
         kresp.addError(604, "Unable to connect to database");
         return kresp.toJsonString();
     };
@@ -321,23 +278,14 @@
     @Consumes(MediaType.APPLICATION_JSON)
     public String search (String json) {
 
-        // Get index
-        KrillIndex index = Node.getIndex();
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
 
         // Search index
-        if (index != null) {
-            Result kr = new Krill(json).apply(index);
-            kr.setNode(Node.getName());
-            return kr.toJsonString();
-        };
-
-        Response kresp = new Response();
-        kresp.setNode(Node.getName());
-        kresp.setName(index.getName());
-        kresp.setVersion(index.getVersion());
-
-        kresp.addError(601, "Unable to find index");
-        return kresp.toJsonString();
+        // Reuse Response
+        Result kr = new Krill(json).apply(Node.getIndex());
+        return kr.toJsonString();
     };
 
 
@@ -346,59 +294,55 @@
     @Produces(MediaType.APPLICATION_JSON)
     public String match (@PathParam("matchID") String id, @Context UriInfo uri) {
 
+        Response kresp = _initResponse();
+        if (kresp.hasErrors())
+            return kresp.toJsonString();
+
         // Get index
         KrillIndex index = Node.getIndex();
 
-        // Search index
-        if (index != null) {
 
-            // Get query parameters
-            MultivaluedMap<String, String> qp = uri.getQueryParameters();
+        // Get query parameters
+        MultivaluedMap<String, String> qp = uri.getQueryParameters();
 
-            boolean includeSpans = false, includeHighlights = true, extendToSentence = false, info = false;
+        boolean includeSpans = false, includeHighlights = true, extendToSentence = false, info = false;
 
-            // Optional query parameter "info" for more information on the match
-            if (!_isNull(qp.getFirst("info")))
-                info = true;
+        // Optional query parameter "info" for more information on the match
+        if (!_isNull(qp.getFirst("info")))
+            info = true;
 
-            // Optional query parameter "spans" for span information inclusion
-            if (!_isNull(qp.getFirst("spans"))) {
-                includeSpans = true;
-                info = true;
-            };
-
-            // Optional query parameter "highlights" for highlight information inclusion
-            String highlights = qp.getFirst("highlights");
-            if (highlights != null && _isNull(highlights))
-                includeHighlights = false;
-
-            // Optional query parameter "extended" for sentence expansion
-            if (!_isNull(qp.getFirst("extended")))
-                extendToSentence = true;
-
-            List<String> foundries = qp.get("foundry");
-            List<String> layers = qp.get("layer");
-
-            try {
-                // Get match info
-                return index.getMatchInfo(id, "tokens", info, foundries,
-                        layers, includeSpans, includeHighlights,
-                        extendToSentence).toJsonString();
-            }
-
-            // Nothing found
-            catch (QueryException qe) {
-                // Todo: Make Match rely on Response!
-                Match km = new Match();
-                km.addError(qe.getErrorCode(), qe.getMessage());
-                return km.toJsonString();
-            }
+        // Optional query parameter "spans" for span information inclusion
+        if (!_isNull(qp.getFirst("spans"))) {
+            includeSpans = true;
+            info = true;
         };
 
-        // Response with error message
-        Match km = new Match();
-        km.addError(601, "Unable to find index");
-        return km.toJsonString();
+        // Optional query parameter "highlights" for highlight information inclusion
+        String highlights = qp.getFirst("highlights");
+        if (highlights != null && _isNull(highlights))
+            includeHighlights = false;
+
+        // Optional query parameter "extended" for sentence expansion
+        if (!_isNull(qp.getFirst("extended")))
+            extendToSentence = true;
+
+        List<String> foundries = qp.get("foundry");
+        List<String> layers = qp.get("layer");
+
+        try {
+            // Get match info
+            return index.getMatchInfo(id, "tokens", info, foundries,
+                                      layers, includeSpans, includeHighlights,
+                                      extendToSentence).toJsonString();
+        }
+
+        // Nothing found
+        catch (QueryException qe) {
+            // Todo: Make Match rely on Response!
+            kresp.addError(qe.getErrorCode(), qe.getMessage());
+        };
+
+        return kresp.toJsonString();
     };
 
 
@@ -455,6 +399,24 @@
     };
 
 
+    private Response _initResponse () {
+        Response kresp = new Response();
+        kresp.setNode(Node.getName());
+        kresp.setListener(Node.getListener());
+
+        // Get index
+        KrillIndex index = Node.getIndex();
+
+        if (index == null) {
+            kresp.addError(601, "Unable to find index");
+            return kresp;
+        };
+
+        kresp.setVersion(index.getVersion());
+        kresp.setName(index.getName());
+        return kresp;
+    };
+
     // Check if a string is meant to represent null
     private static boolean _isNull (String value) {
         if (value == null)
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
index 932426a..2449452 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionIndex.java
@@ -153,7 +153,6 @@
         kcn.fromBuilder(cb.orGroup().with(cb.term("textClass", "kultur").not())
                 .with(cb.term("author", "Sebastian")));
         assertEquals(1, kcn.docCount());
-
     };
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
index 2736722..6c2b2f9 100644
--- a/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/collection/TestKrillCollectionJSON.java
@@ -95,6 +95,16 @@
 
 
     @Test
+    public void collectionWithNegativeContainment () {
+        String query = _getJSONString("collection_containsnot.jsonld");
+        Krill ks = new Krill(query);
+        assertFalse(ks.hasErrors());
+        assertFalse(ks.hasWarnings());
+        assertFalse(ks.hasMessages());
+        assertEquals("-author:goethe", ks.getCollection().toString());
+    };
+
+    @Test
     public void nocollectiontypegiven () {
         String metaQuery = _getJSONString("multiterm_rewrite_collection.jsonld");
         KrillCollection kc = new KrillCollection(metaQuery);
@@ -146,6 +156,9 @@
     };
 
 
+
+
+    // Legacy collections reflect old tests, that were adopted to the new scheme
     @Test
     public void metaQuery1Legacy () {
         String metaQuery = getString(getClass().getResource(
diff --git a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
index b93ddfb..99bc0a5 100644
--- a/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
+++ b/src/test/java/de/ids_mannheim/korap/response/TestResponse.java
@@ -24,7 +24,11 @@
     @Test
     public void testResponse () throws IOException {
         Response resp = new Response();
-        assertEquals("{\"meta\":{}}", resp.toJsonString());
+        JsonNode respJson = mapper.readTree(resp.toJsonString());
+        assertEquals("http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
+                     respJson.at("/@context").asText());
+        assertEquals("", respJson.at("/meta").asText());
+
         resp.setVersion("0.24");
         resp.setNode("Tanja");
         assertEquals("0.24", resp.getVersion());
@@ -34,7 +38,7 @@
         assertFalse(resp.hasMessages());
         assertFalse(resp.hasErrors());
 
-        JsonNode respJson = mapper.readTree(resp.toJsonString());
+        respJson = mapper.readTree(resp.toJsonString());
         assertEquals("0.24", respJson.at("/meta/version").asText());
         assertEquals("Tanja", respJson.at("/meta/node").asText());
 
@@ -54,7 +58,10 @@
     @Test
     public void testResponseNotifications () throws IOException {
         Response resp = new Response();
-        assertEquals("{\"meta\":{}}", resp.toJsonString());
+        JsonNode respJson = mapper.readTree(resp.toJsonString());
+        assertEquals("http://korap.ids-mannheim.de/ns/KoralQuery/v0.3/context.jsonld",
+                     respJson.at("/@context").asText());
+        assertEquals("", respJson.at("/meta").asText());
         resp.setVersion("0.24");
         resp.setNode("Tanja");
         assertEquals("0.24", resp.getVersion());
@@ -64,7 +71,7 @@
         assertFalse(resp.hasMessages());
         assertFalse(resp.hasErrors());
 
-        JsonNode respJson = mapper.readTree(resp.toJsonString());
+        respJson = mapper.readTree(resp.toJsonString());
         assertEquals("0.24", respJson.at("/meta/version").asText());
         assertEquals("Tanja", respJson.at("/meta/node").asText());
 
diff --git a/src/test/java/de/ids_mannheim/korap/server/TestResource.java b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
index 635e897..643f081 100644
--- a/src/test/java/de/ids_mannheim/korap/server/TestResource.java
+++ b/src/test/java/de/ids_mannheim/korap/server/TestResource.java
@@ -82,6 +82,7 @@
     };
 
 
+    // This tests the node info
     @Test
     public void testInfo () throws IOException {
         String responseMsg = target.path("/").request().get(String.class);
@@ -90,7 +91,6 @@
         assertEquals(680, res.at("/messages/0/0").asInt());
     };
 
-
     @Test
     public void testResource () throws IOException {
         String resp;
@@ -111,7 +111,7 @@
 
                 res = mapper.readTree(resp);
                 assertEquals("milena", res.at("/meta/node").asText());
-                assertEquals(681, res.at("/messages/0/0").asInt());
+                // System.err.println(res.toString());
             }
             catch (Exception e) {
                 fail("Server response failed " + e.getMessage()
diff --git a/src/test/resources/queries/collections/collection_containsnot.jsonld b/src/test/resources/queries/collections/collection_containsnot.jsonld
new file mode 100644
index 0000000..0443116
--- /dev/null
+++ b/src/test/resources/queries/collections/collection_containsnot.jsonld
@@ -0,0 +1,26 @@
+{
+  "@context":"http://korap.ids-mannheim.de/ns/koral/0.3/context.jsonld",
+  "errors":[],
+  "warnings":[],
+  "messages":[],
+  "query":{
+    "@type":"koral:token",
+    "wrap":{
+      "@type":"koral:term",
+      "layer":"orth",
+      "key":"der",
+      "match":"match:eq",	
+      "foundry":"opennlp"
+    }
+  },
+  "collection":{
+    "value":"Goethe",
+    "match":"match:containsnot",
+    "type":"type:string",
+    "key":"author",
+    "@type":"koral:doc"
+  },
+  "meta":{
+    "cutOff":null
+  }
+}
