diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/JsonGenerator.java b/src/main/java/de/ids_mannheim/korap/query/serialize/JsonGenerator.java
index 9c7677b..a582540 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/JsonGenerator.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/JsonGenerator.java
@@ -39,7 +39,7 @@
         if (args.length == 0) {
             queries = new String[]{
                     /*
-					 * negation
+                     * negation
 					 * elemente
 					 * within
 					 * regex
@@ -126,9 +126,10 @@
         }
         Map<String, Object> requestMap = ast.getRequestMap();
         try {
-            List<Map> meta_re = serializer.serializeResources(parents);
+            List meta_re = serializer.serializeResources(parents);
 
-
+//            JsonNode node = mapper.valueToTree(parents);
+//            JsonNode arr = node.get("meta");
             requestMap.put("meta", meta_re);
             requestMap = serializer.addParameters(requestMap, page, num,
                     cli, cri, cls, crs);
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaCollectionSerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaCollectionSerializer.java
index 8655288..bd55641 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaCollectionSerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaCollectionSerializer.java
@@ -84,25 +84,12 @@
         this.tester = tester();
     }
 
-    @Deprecated
-    public String serialize(String resource) throws IOException {
-        Map metas = new HashMap();
-        Map<String, String> pa = getParents(resource);
-        List<Map> parids = new ArrayList<>();
-        for (String key : pa.keySet()) {
-            Map re = types.mapify(pa.get(key));
-            parids.add(re);
-        }
-        metas.put("meta", parids);
-        return mapper.writeValueAsString(metas);
-    }
     //resources must be ordered: 0 without parent, 1 has 0 as parent, etc.
-    public List<Map> serialize(List<String> r_queries) throws IOException {
-        Map metas = new HashMap();
-        List<Map> parids = new ArrayList<>();
+    public List<ArrayList> serializeResource(List<String> r_queries) throws IOException {
+        List parids = new ArrayList<>();
         for (String query : r_queries) {
-            Map re = types.mapify(query);
-            parids.add(re);
+            ArrayList m = mapper.readValue(query, ArrayList.class);
+            parids.add(m);
         }
         return parids;
     }
@@ -145,5 +132,4 @@
     }
 
 
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuerySerializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuerySerializer.java
index c7d31f1..ba0cd8a 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuerySerializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaQuerySerializer.java
@@ -167,13 +167,6 @@
         return new ArrayList<>(metavalue);
     }
 
-    //todo: resource id must be added!
-    public String stringify(Map<String, String> queries, TYPE type) throws IOException {
-        Map f = new HashMap();
-        f.put("meta", serializeQueries(queries, type));
-        return mapper.writeValueAsString(f);
-    }
-
     //fixme: only allows for one until and since entry!!
     private String[] processDates(List<String> dates) {
         if (dates.isEmpty())
@@ -197,7 +190,6 @@
                 el[idx] = types.formatDate(Long.valueOf(value), MetaTypes.YMD);
                 idx++;
             }
-
         }
         if (range)
             el[0] = "r";
@@ -209,6 +201,13 @@
         return mapper.valueToTree(s);
     }
 
+    //todo: resource id must be added!
+    public String stringify(Map<String, String> queries, TYPE type) throws IOException {
+        Map f = new HashMap();
+        f.put("meta", serializeQueries(queries, type));
+        return mapper.writeValueAsString(f);
+    }
+
 
     public enum TYPE {
         EXTEND, FILTER
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
index dc47121..405dc4b 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/MetaTypes.java
@@ -6,6 +6,7 @@
 
 import java.io.IOException;
 import java.util.LinkedHashMap;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 
@@ -116,6 +117,10 @@
         return mapper.readValue(s, Map.class);
     }
 
+    public List listify(String s) throws IOException {
+        return mapper.readValue(s, LinkedList.class);
+    }
+
     public String stringify(Map m) throws JsonProcessingException {
         return mapper.writeValueAsString(m);
     }
diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/Serializer.java b/src/main/java/de/ids_mannheim/korap/query/serialize/Serializer.java
index 3e24e4c..8edf09d 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/Serializer.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/Serializer.java
@@ -24,14 +24,18 @@
         this.mapper = new ObjectMapper();
     }
 
-    public String serializeMeta(List m_queries) throws JsonProcessingException {
-//        Map metas = new HashMap();
-//        metas.put("meta", m_queries);
+    public String serializeToMeta(List m_queries) throws JsonProcessingException {
+        Map metas = new HashMap();
+        metas.put("meta", m_queries);
+        return mapper.writeValueAsString(metas);
+    }
+
+    public String stringify(List m_queries) throws JsonProcessingException {
         return mapper.writeValueAsString(m_queries);
     }
 
-    public List<Map> serializeResources(List<String> r_queries) throws IOException {
-        return cs.serialize(r_queries);
+    public List<ArrayList> serializeResources(List<String> r_queries) throws IOException {
+        return cs.serializeResource(r_queries);
     }
 
     public List<Map> serializeQueries(Map<String, String> queries, MetaQuerySerializer.TYPE type) {
diff --git a/src/test/java/MetaQuerySerializationTest.java b/src/test/java/MetaQuerySerializationTest.java
index b1062d8..bd40204 100644
--- a/src/test/java/MetaQuerySerializationTest.java
+++ b/src/test/java/MetaQuerySerializationTest.java
@@ -11,10 +11,7 @@
 import org.junit.runners.JUnit4;
 
 import java.io.IOException;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * @author hanl
@@ -50,12 +47,7 @@
         j.put("textClass", "wissenschaft");
         String s = querySerializer.stringify(j, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("------ TEXT SINGLE " + s);
-    }
-
-    @Test
-    public void testResourceMeta() throws IOException {
-        String s = collSerializer.serialize("25");
-        System.out.println(" --- RESULT JSON " + s);
+        System.out.println();
     }
 
     @Test
@@ -66,6 +58,7 @@
         queries.put("author", "Goethe");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value until/since : " + f);
+        System.out.println();
     }
 
     @Test
@@ -75,6 +68,7 @@
         queries.put("author", "Hesse");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value until : " + f);
+        System.out.println();
     }
 
     @Test
@@ -84,6 +78,7 @@
         queries.put("author", "Kafka");
         String f = querySerializer.stringify(queries, MetaQuerySerializer.TYPE.FILTER);
         System.out.println("value since : " + f);
+        System.out.println();
     }
 
     //@Test
@@ -109,6 +104,7 @@
             } catch (NullPointerException npe) {
                 npe.printStackTrace();
                 System.out.println("null\n");
+                System.out.println();
             } catch (JsonGenerationException e) {
                 e.printStackTrace();
             } catch (JsonMappingException e) {
@@ -132,6 +128,8 @@
         List f = querySerializer.serializeQueries(queries, MetaQuerySerializer.TYPE.EXTEND);
         s.addAll(f);
         System.out.println("--- ALL " + s);
+        System.out.println();
+
     }
 
     @Test
@@ -140,7 +138,25 @@
         queries.put("pubDate", "<" + String.valueOf(new DateTime().getMillis()));
         queries.put("author", "Kafka");
         List s = querySerializer.serializeQueries(queries, MetaQuerySerializer.TYPE.FILTER);
-        System.out.println("array repres " + ser.serializeMeta(s));
+        System.out.println("array repres " + ser.serializeToMeta(s));
+        System.out.println();
+    }
+
+    @Test
+    public void testCollections() throws IOException {
+        Map<String, String> query = new LinkedHashMap<>();
+        Serializer ser = new Serializer();
+        query.put("corpusID", "WPD");
+
+        List<Map> p = ser.serializeQueries(query, MetaQuerySerializer.TYPE.FILTER);
+        String s = ser.stringify(p);
+
+        System.out.println("results " + s);
+        System.out.println();
+        List<String> l = new ArrayList<>();
+        l.add(s);
+        collSerializer.serializeResource(l);
+
     }
 
 }
