diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
index ef0c1d2..8d00d7a 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
@@ -116,16 +116,16 @@
 
 
 
-    public JsonNode process(JsonNode root, User user) {
+    public String process(JsonNode root, User user) {
         RewriteProcess process = new RewriteProcess(root, user);
         JsonNode pre = process.start(false);
         //return iterate(pre, user, true);
-        return pre;
+        return JsonUtils.toJSON(pre);
     }
 
 
     public String process(String json, User user) {
-        return JsonUtils.toJSON(process(JsonUtils.readTree(json), user));
+        return process(JsonUtils.readTree(json), user);
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java b/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
index ebe6910..532e8f3 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.resources;
 
 import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
 import lombok.AccessLevel;
@@ -99,7 +100,11 @@
     }
 
 
-    public String getData () {
+    public JsonNode getData () {
+        return JsonUtils.valueToTree(this.fields);
+    }
+
+    public String getStringData() {
         return JsonUtils.toJSON(this.fields);
     }
 
@@ -178,8 +183,9 @@
         //        m.put("path", path);
         m.put("description", description);
         m.put("created", TimeUtils.format(new DateTime(created)));
-        m.put("data", getData());
+        m.put("data", this.fields);
         // deprecated
+        // todo:
         //        m.put("managed", managed);
         //        m.put("shared", shared);
         return m;
diff --git a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
index 9458ffc..c6de012 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
@@ -63,8 +63,8 @@
 
 
     public static <T extends KustvaktResource> T createID (T resource) {
-        if (resource.getData() != null && !resource.getData().isEmpty())
-            resource.setPersistentID(DigestUtils.sha1Hex(resource.getData()));
+        if (resource.getData() != null && !resource.getStringData().isEmpty())
+            resource.setPersistentID(DigestUtils.sha1Hex(resource.getStringData()));
         return resource;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
index a736b1d..4d6b6f1 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
@@ -23,6 +23,7 @@
     private boolean verbose;
     private JsonNode base;
     private StringBuilder builder;
+    private String mergeOperator;
 
 
     public KoralCollectionQueryBuilder() {
@@ -34,6 +35,7 @@
         this.verbose = verbose;
         this.builder = new StringBuilder();
         this.base = null;
+        this.mergeOperator = null;
     }
 
 
@@ -75,44 +77,53 @@
 
 
     public KoralCollectionQueryBuilder and () {
-        this.builder.append(" & ");
+        if (this.builder.length() != 0)
+            this.builder.append(" & ");
+        if (this.base != null && this.mergeOperator == null)
+            this.mergeOperator = "AND";
         return this;
     }
 
 
     public KoralCollectionQueryBuilder or () {
-        this.builder.append(" | ");
+        if (this.builder.length() != 0)
+            this.builder.append(" | ");
+        if (this.base != null && this.mergeOperator == null)
+            this.mergeOperator = "OR";
         return this;
     }
 
 
     public Object rebaseCollection () {
-        if (builder.length() == 0 && base == null)
+        if (this.builder.length() == 0 && this.base == null)
             return null;
 
         JsonNode request = null;
-        if (builder.length() != 0) {
+        if (this.builder.length() != 0) {
             CollectionQueryProcessor tree = new CollectionQueryProcessor(
                     this.verbose);
             tree.process(this.builder.toString());
             request = JsonUtils.valueToTree(tree.getRequestMap());
         }
 
-        if (base != null) {
+        if (this.base != null) {
             // check that collection non empty
+            JsonNode tmp = this.base.deepCopy();
             if (request != null) {
                 JsonNode tobase = request.at("/collection");
-                request = base.deepCopy();
-                JsonNode result = JsonBuilder.buildDocGroup("and",
+                request = tmp;
+                JsonNode result = JsonBuilder.buildDocGroup(this.mergeOperator != null
+                        ? this.mergeOperator.toLowerCase() : "and",
                         request.at("/collection"), tobase);
                 ((ObjectNode) request).put("collection", result);
-            }
+            } else
+                request = tmp;
         }
         return request;
     }
 
     public JsonNode mergeWith(JsonNode node) {
-        if (base != null) {
+        if (this.base != null) {
             // check that collection non empty
             if (node != null) {
                 JsonNode tobase = node.at("/collection");
@@ -139,6 +150,10 @@
         this.base = JsonUtils.readTree(query);
         return this;
     }
+    public KoralCollectionQueryBuilder setBaseQuery (JsonNode query) {
+        this.base = query;
+        return this;
+    }
 
 
     public String toJSON () {
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index 17f8595..8ff8f3c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -381,8 +381,9 @@
                 resource = this.resourceHandler.findbyStrId(id, user,
                         ResourceFactory.getResourceClass(type));
 
+            // todo: test this
             if (resource instanceof VirtualCollection)
-                cquery.with((String) resource.getData());
+                cquery.mergeWith(resource.getData());
             else if (resource instanceof Corpus)
                 cquery.with(Attributes.CORPUS_SIGLE + resource.getPersistentID());
 
@@ -548,7 +549,7 @@
                             ResourceFactory.getResourceClass(type));
 
                 if (resource instanceof VirtualCollection)
-                    builder.setBaseQuery((String) resource.getData());
+                    builder.setBaseQuery(resource.getData());
                 else if (resource instanceof Corpus)
                     builder.with(Attributes.CORPUS_SIGLE+ resource.getPersistentID());
                 else
@@ -704,9 +705,7 @@
         VirtualCollection tmp = resourceHandler.getCache(cache.getId(),
                 VirtualCollection.class);
         if (tmp == null) {
-            KoralCollectionQueryBuilder cquery = new KoralCollectionQueryBuilder()
-                    .setBaseQuery((String) cache.getData());
-            String query = this.processor.process((String) cache.getData(),
+            String query = this.processor.process(cache.getData(),
                     user);
             String stats = searchKrill.getStatistics(query);
             cache.setStats(JsonUtils.readSimple(stats, Map.class));
@@ -785,10 +784,10 @@
                 .getResourceClass(type))) {
             VirtualCollection cachetmp, collection;
 
-            String base;
+            JsonNode base;
             if (reference != null && !reference.equals("null")) {
                 try {
-                    base = (String) resourceHandler.findbyStrId(reference,
+                    base = resourceHandler.findbyStrId(reference,
                             user, VirtualCollection.class).getData();
                 }
                 catch (KustvaktException e) {
@@ -797,7 +796,7 @@
 
             }
             else if (query != null)
-                base = query;
+                base = JsonUtils.readTree(query);
             else
                 // todo: throw exception response for no resource to save!
                 return null;
@@ -839,13 +838,14 @@
 
     /**
      * store a virtual collection. Retrieve cached entry first and
-     * then store VCollection
+     * then store collection
      * 
      * @param context
      * @param locale
      * @param query
      * @return
      */
+    // todo: testing
     @POST
     @Path("{type}")
     public Response storeResource (@Context SecurityContext context,
@@ -873,28 +873,21 @@
                 .getResourceClass(type))) {
 
             VirtualCollection cachetmp, collection;
-            // todo: ??
-            Object read = JsonUtils.readTree(query);
+
             KoralCollectionQueryBuilder cquery = new KoralCollectionQueryBuilder();
             if (reference != null && !reference.equals("null")) {
                 try {
-                    cquery.with((String) resourceHandler.findbyStrId(
+                    cquery.setBaseQuery(resourceHandler.findbyStrId(
                             reference, user, VirtualCollection.class).getData());
+
                 }
                 catch (KustvaktException e) {
                     throw KustvaktResponseHandler.throwit(e);
                 }
-                // todo: 11.01
-                //                if (!filter)
-                //                    cquery.addMetaExtendQuery(query);
-                //                else
-                //                    cquery.addMetaFilterQuery(query);
-                //            }else {
-                //                if (read != null)
-                //                    cquery.addResource(query);
-                //                else
-                //                    cquery.addMetaFilterQuery(query);
             }
+            if (query != null && !query.isEmpty())
+                cquery.with(query);
+
             cachetmp = ResourceFactory.getCachedCollection(cquery.toJSON());
 
             // see if vc was cached!
diff --git a/src/test/java/CollectionQueryBuilderTest.java b/src/test/java/CollectionQueryBuilderTest.java
index 38a5ac4..407608d 100644
--- a/src/test/java/CollectionQueryBuilderTest.java
+++ b/src/test/java/CollectionQueryBuilderTest.java
@@ -2,6 +2,7 @@
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
 import de.ids_mannheim.korap.utils.JsonUtils;
+import org.junit.Ignore;
 import org.junit.Test;
 
 import static org.junit.Assert.assertEquals;
@@ -84,12 +85,19 @@
         c.with("corpusSigle=WPD");
 
         JsonNode node = JsonUtils.readTree(c.toJSON());
-
         assertNotNull(node);
-        assertEquals("koral:doc", node.at("/collection/operands/0/@type")
+        assertEquals("koral:doc", node.at("/collection/operands/1/@type")
                 .asText());
-        assertEquals("WPD", node.at("/collection/operands/0/value").asText());
+        assertEquals("koral:docGroup", node.at("/collection/operands/0/@type")
+                .asText());
         assertEquals(2, node.at("/collection/operands").size());
+        assertEquals(2, node.at("/collection/operands/0/operands").size());
+        assertEquals(2, node.at("/collection/operands/0/operands/0/operands").size());
+
+        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals("operation:or", node.at("/collection/operands/0/operation").asText());
+        assertEquals("operation:and", node.at("/collection/operands/0/operands/0/operation").asText());
+        assertEquals("WPD", node.at("/collection/operands/1/value").asText());
     }
 
 
@@ -109,13 +117,13 @@
         assertEquals("koral:docGroup", node.at("/collection/operands/1/@type")
                 .asText());
         assertEquals("BRZ13", node
-                .at("/collection/operands/0/operands/0/value").asText());
-        assertEquals("AZPS", node.at("/collection/operands/0/operands/1/value")
+                .at("/collection/operands/1/operands/0/value").asText());
+        assertEquals("AZPS", node.at("/collection/operands/1/operands/1/value")
                 .asText());
         assertEquals("random title",
-                node.at("/collection/operands/1/operands/0/value").asText());
+                node.at("/collection/operands/0/operands/0/value").asText());
         assertEquals("wissenschaft",
-                node.at("/collection/operands/1/operands/1/value").asText());
+                node.at("/collection/operands/0/operands/1/value").asText());
     }
 
 
@@ -137,14 +145,14 @@
         assertEquals("operation:and", res.at("/collection/operation").asText());
         assertEquals("koral:doc", res.at("/collection/operands/0/@type")
                 .asText());
-        assertEquals("freizeit", res.at("/collection/operands/0/value")
+        assertEquals("freizeit", res.at("/collection/operands/1/value")
                 .asText());
-        assertEquals("textClass", res.at("/collection/operands/0/key").asText());
+        assertEquals("textClass", res.at("/collection/operands/1/key").asText());
 
         assertEquals("koral:doc", res.at("/collection/operands/1/@type")
                 .asText());
-        assertEquals("WPD", res.at("/collection/operands/1/value").asText());
-        assertEquals("corpusSigle", res.at("/collection/operands/1/key").asText());
+        assertEquals("WPD", res.at("/collection/operands/0/value").asText());
+        assertEquals("corpusSigle", res.at("/collection/operands/0/key").asText());
 
         // check also that query is still there
         assertEquals("koral:token", res.at("/query/@type").asText());
@@ -166,12 +174,12 @@
         JsonNode base = (JsonNode) c.rebaseCollection();
         assertNotNull(base);
         assertEquals(base.at("/collection/@type").asText(), "koral:docGroup");
-        assertEquals(base.at("/collection/operands/0/@type").asText(),
-                "koral:doc");
-        assertEquals(base.at("/collection/operands/0/value").asText(), "BRZ13");
         assertEquals(base.at("/collection/operands/1/@type").asText(),
+                "koral:doc");
+        assertEquals(base.at("/collection/operands/1/value").asText(), "BRZ13");
+        assertEquals(base.at("/collection/operands/0/@type").asText(),
                 "koral:docGroup");
-        assertEquals(base.at("/collection/operands/1/operands").size(), 2);
+        assertEquals(base.at("/collection/operands/0/operands").size(), 2);
     }
 
     @Test
@@ -201,4 +209,80 @@
 
     }
 
+    @Test
+    public void testAddOROperator() {
+        String coll = "corpusSigle=WPD";
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+        check.setCollection(coll);
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        test.setBaseQuery(check.toJSON());
+        test.or().with("textClass=wissenschaft | textClass=politik");
+        JsonNode node = (JsonNode) test.rebaseCollection();
+        assertNotNull(node);
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("operation:or", node.at("/collection/operation").asText());
+        assertEquals(2, node.at("/collection/operands/1/operands").size());
+    }
+
+    @Test
+    public void testAddANDOperator() {
+        String coll = "corpusSigle=WPD";
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+        check.setCollection(coll);
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        test.setBaseQuery(check.toJSON());
+        test.and().with("textClass=wissenschaft | textClass=politik");
+        JsonNode node = (JsonNode) test.rebaseCollection();
+        assertNotNull(node);
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals(2, node.at("/collection/operands/1/operands").size());
+    }
+
+    @Test
+    public void testAddDefaultOperator() {
+        String coll = "corpusSigle=WPD";
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+        check.setCollection(coll);
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        test.setBaseQuery(check.toJSON());
+        test.with("textClass=wissenschaft | textClass=politik");
+        JsonNode node = (JsonNode) test.rebaseCollection();
+        assertNotNull(node);
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals(2, node.at("/collection/operands/1/operands").size());
+    }
+
+    @Test
+    @Ignore
+    public void testMergeOperator() {
+        String coll = "corpusSigle=WPD";
+        String query = "[base=Haus]";
+        QuerySerializer check = new QuerySerializer();
+        check.setQuery(query, "poliqarp");
+        check.setCollection(coll);
+
+        KoralCollectionQueryBuilder b = new KoralCollectionQueryBuilder();
+        b.setBaseQuery(check.toJSON());
+
+        KoralCollectionQueryBuilder test = new KoralCollectionQueryBuilder();
+        test.with("textClass=wissenschaft | textClass=politik");
+        JsonNode node = (JsonNode) test.rebaseCollection();
+        node = b.mergeWith(node);
+        assertNotNull(node);
+        assertEquals("koral:docGroup", node.at("/collection/@type").asText());
+        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals(2, node.at("/collection/operands").size());
+    }
+
 }
diff --git a/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java b/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
index 92ef92c..90bcc86 100644
--- a/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
+++ b/src/test/java/de/ids_mannheim/korap/resource/rewrite/FoundryRewriteTest.java
@@ -65,8 +65,6 @@
         s.setQuery("[base=Haus]", "poliqarp");
         String result = processor.process(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
-
-        System.out.println("REWRITTEN "+ node);
         assertNotNull(node);
         assertFalse(node.at("/query/wrap/foundry").isMissingNode());
         assertEquals(c.getDefault_lemma(), node.at("/query/wrap/foundry")
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java b/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
index 0a55637..d7e33b9 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/OAuth2HandlerTest.java
@@ -13,6 +13,8 @@
 import org.junit.BeforeClass;
 import org.junit.Test;
 
+import static org.junit.Assert.assertNotNull;
+
 /**
  * @author hanl
  * @date 13/05/2015
@@ -65,7 +67,7 @@
                 .getPersistenceClient());
         handler.authorize(codeInfo, helper().getUser());
         codeInfo = handler.getAuthorization(auth_code);
-        Assert.assertNotNull("client is null!", codeInfo);
+        assertNotNull("client is null!", codeInfo);
     }
 
 
@@ -84,7 +86,7 @@
         handler.addToken(codeInfo.getCode(), t, refresh, 7200);
 
         TokenContext ctx = handler.getContext(t);
-        Assert.assertNotNull("context is null", ctx);
+        assertNotNull("context is null", ctx);
 
         AuthCodeInfo c2 = handler.getAuthorization(codeInfo.getCode());
         Assert.assertNull("clearing authorization failed", c2);
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
index d0a5b96..6a5ab99 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
@@ -189,13 +189,13 @@
     @Test
     public void testGetResources () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").get(ClientResponse.class);
+                .path("collection").get(ClientResponse.class);
         assertEquals(response.getStatus(),
                 ClientResponse.Status.OK.getStatusCode());
         String ent = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
-        System.out.println("NODE 1 " + node);
+        assertNotEquals(0, node.size());
     }
 
 
