diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
index 851cc31..7cda44e 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CollectionQuery.java
@@ -202,6 +202,7 @@
      *
      * @return
      */
+    @Deprecated
     public String stringify() {
         List collection = getCollectionsOnly();
         if (collection.isEmpty())
@@ -215,6 +216,22 @@
         }
     }
 
+
+    /**
+     * returns all references to parents and meta query as string representation
+     *
+     * @return
+     */
+    public String stringifyAll() {
+        try {
+            return serialzer.writeValueAsString(join());
+        } catch (JsonProcessingException e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+
+
     /**
      * returns the List<Map> that contains all the meta queries and resource queries
      * added to the meta query container
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
index 493758e..e6ffbe6 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/QuerySerializer.java
@@ -129,14 +129,20 @@
                              String cli, String cri, int cls, int crs,
                              int num, int page, boolean cutoff)
             throws QueryException {
-        if (ql.toLowerCase().equals("poliqarp")) {
-            ast = new PoliqarpPlusTree(query);
-        } else if (ql.toLowerCase().equals("cosmas2")) {
-            ast = new CosmasTree(query);
-        } else if (ql.toLowerCase().equals("poliqarpplus")) {
-            ast = new PoliqarpPlusTree(query);
-        } else {
-            throw new QueryException(ql + " is not a supported query language!");
+        try {
+            if (ql.toLowerCase().equals("poliqarp")) {
+                ast = new PoliqarpPlusTree(query);
+            } else if (ql.toLowerCase().equals("cosmas2")) {
+                ast = new CosmasTree(query);
+            } else if (ql.toLowerCase().equals("poliqarpplus")) {
+                ast = new PoliqarpPlusTree(query);
+            } else {
+                throw new QueryException(ql + " is not a supported query language!");
+            }
+        } catch (QueryException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new QueryException("UNKNOWN: Query could not be parsed");
         }
 
         Map<String, Object> requestMap = ast.getRequestMap();
@@ -149,11 +155,17 @@
         meta.addEntry("startPage", page);
         meta.addEntry("count", num);
 
-        try {
+        try
+
+        {
             requestMap.put("collections", collectionQuery.raw());
             requestMap.put("meta", meta.raw());
             return mapper.writeValueAsString(requestMap);
-        } catch (IOException e) {
+        } catch (
+                IOException e
+                )
+
+        {
             return "";
         }
 
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index a1c1879..03cd549 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -1,6 +1,7 @@
 import com.fasterxml.jackson.core.JsonGenerationException;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.JsonMappingException;
+import de.ids_mannheim.korap.query.serialize.CollectionQuery;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.query.serialize.MetaQuery;
 import de.ids_mannheim.korap.util.QueryException;
@@ -30,14 +31,14 @@
         b.append("pubPlace:Erfurt");
         b.append(" AND ");
         b.append("textClass:wissenschaft");
-        MetaQuery qu = new MetaQuery().addMetaFilter(b.toString());
+        CollectionQuery qu = new CollectionQuery().addMetaFilter(b.toString());
 //        System.out.println("value reference " + qu.stringify());
 //        System.out.println();
     }
 
     @Test
     public void testSingle() throws IOException {
-        MetaQuery query = new MetaQuery().addMetaFilter("textClass", "wissenschaft");
+        CollectionQuery query = new CollectionQuery().addMetaFilter("textClass", "wissenschaft");
 //        System.out.println("------ TEXT SINGLE " + query.stringify());
         System.out.println();
     }
@@ -50,9 +51,9 @@
         b.append("pubDate:<2012-04-01");
         b.append(" AND ");
         b.append("author:Goethe");
-        MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
         System.out.println("value until/since : " + query.stringify());
-        System.out.println("meta value until/since " + query.toMeta());
+        System.out.println("meta value until/since " + query.toCollections());
         Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Goethe\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"between\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2012-04-01\"},{\"@type\":\"korap:date\",\"@value\":\"2013-04-01\"}]}]}}]", query.stringify());
 //        System.out.println();
     }
@@ -63,7 +64,7 @@
         b.append("pubDate:>2013-12-10");
         b.append(" AND ");
         b.append("author:Hesse");
-        MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
         System.out.println("Running date check (until) with additional attribute author");
         Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Hesse\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"until\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.stringify());
 //        System.out.println("value until : " + query.stringify());
@@ -76,9 +77,9 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
         System.out.println("value since : " + query.stringify());
-        System.out.println("meta value since " + query.toMeta());
+        System.out.println("meta value since " + query.toCollections());
 //        System.out.println();
         System.out.println("Running date check (since) with additional attribute author");
         Assert.assertEquals("[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:group\",\"relation\":\"and\",\"operands\":[{\"@type\":\"korap:term\",\"@field\":\"korap:field#author\",\"@value\":\"Kafka\"},{\"@type\":\"korap:group\",\"@field\":\"korap:field#pubDate\",\"relation\":\"since\",\"operands\":[{\"@type\":\"korap:date\",\"@value\":\"2013-12-10\"}]}]}}]", query.stringify());
@@ -124,7 +125,7 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        MetaQuery query = new MetaQuery().addMetaFilter(b.toString());
+        CollectionQuery query = new CollectionQuery().addMetaFilter(b.toString());
         query.addMetaExtend("author", "Hesse");
 
 //        System.out.println("--- ALL " + query.stringify());
@@ -138,14 +139,14 @@
         b.append("pubDate:<2013-12-10");
         b.append(" AND ");
         b.append("author:Kafka");
-        MetaQuery q = new MetaQuery().addMetaExtend(b.toString());
+        CollectionQuery q = new CollectionQuery().addMetaExtend(b.toString());
 //        System.out.println("array repres " + q.toMeta());
 //        System.out.println();
     }
 
     @Test
     public void testCollections() throws IOException {
-        MetaQuery q = new MetaQuery().addMetaFilter("corpusID", "A00");
+        CollectionQuery q = new CollectionQuery().addMetaFilter("corpusID", "A00");
         q.addMetaExtend("corpusID", "A01");
 
 //        System.out.println("results stringified " + q.stringify());
@@ -162,16 +163,16 @@
     @Test
     public void testResources() throws IOException {
         String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
-        MetaQuery q = new MetaQuery().addResource(meta);
+        CollectionQuery q = new CollectionQuery().addResource(meta);
         org.junit.Assert.assertEquals("String should be empty", "", q.stringify());
 //        System.out.println("meta string " + q.toMeta());
         System.out.println("Testing Resource Meta data");
-        org.junit.Assert.assertEquals("{\"meta\":" + meta + "}", q.toMeta());
+        org.junit.Assert.assertEquals("{\"meta\":" + meta + "}", q.toCollections());
     }
 
     @Test
     public void testA00() throws IOException {
-        MetaQuery q = new MetaQuery().addMetaExtend("corpusID", "A00").addMetaExtend("corpusID", "A01");
+        CollectionQuery q = new CollectionQuery().addMetaExtend("corpusID", "A00").addMetaExtend("corpusID", "A01");
 //        System.out.println("A meta: " + q.stringify());
 //        System.out.println();
     }
@@ -179,7 +180,7 @@
     @Test
     public void testResources2() throws IOException {
         String meta = "[{\"@type\":\"korap:meta-filter\",\"@value\":{\"@type\":\"korap:term\",\"@field\":\"korap:field#corpusID\",\"@value\":\"WPD\"}}]";
-        MetaQuery q = new MetaQuery().addResource(meta);
+        CollectionQuery q = new CollectionQuery().addResource(meta);
         q.addMetaFilter("textClass", "wissenschaft");
 //        System.out.println("stringified meta " + q.stringify());
 //        System.out.println("meta string " + q.toMeta());
