diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/IdWriter.java b/src/main/java/de/ids_mannheim/korap/query/serialize/IdWriter.java
new file mode 100644
index 0000000..7249df7
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/IdWriter.java
@@ -0,0 +1,73 @@
+package de.ids_mannheim.korap.query.serialize;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+import java.util.Iterator;
+
+/**
+ * @author hanl
+ * @date 04/06/2014
+ * <p/>
+ * create idn for korap:token
+ */
+public class IdWriter {
+
+    private JsonNode node;
+    private int counter;
+
+    public IdWriter(String json) {
+        node = JsonUtils.readTree(json);
+        counter = 0;
+    }
+
+    public IdWriter process() {
+        process(node.path("query"));
+        return this;
+    }
+
+    private void process(JsonNode node) {
+        if (node.path("@type").asText().equals("korap:group")) {
+            Iterator<JsonNode> operands = node.path("operands").elements();
+            while (operands.hasNext())
+                process(operands.next());
+        } else if (node.path("@type").asText().equals("korap:token"))
+            addId(node);
+    }
+
+    private JsonNode addId(JsonNode node) {
+        if (node.isObject()) {
+            ObjectNode o = (ObjectNode) node;
+            String s = extractToken(node);
+            if (s != null && !s.isEmpty())
+                o.put("idn", s + "_" + counter++);
+        }
+        return node;
+    }
+
+    private String extractToken(JsonNode token) {
+        if (!token.path("@type").equals("korap:term")) {
+            JsonNode wrap = token.path("wrap");
+            JsonNode op = token.path("operands");
+            if (!wrap.isMissingNode())
+                return extractToken(wrap);
+            if (!op.isMissingNode()) {
+                Iterator<JsonNode> operands = op.elements();
+                while (operands.hasNext())
+                    return extractToken(operands.next());
+            }
+        }
+        return token.path("key").asText();
+
+    }
+
+    public JsonNode getFinalNode() {
+        return this.node;
+    }
+
+    public String toJSON() {
+        return JsonUtils.toJSON(node);
+    }
+
+}
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 cde7b8b..a4f0a0b 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
@@ -124,16 +124,16 @@
     public QuerySerializer setQuery(String query, String ql, String version)
             throws QueryException {
         try {
-            if (ql.toLowerCase().equals("poliqarp")) {
+            if (ql.equalsIgnoreCase("poliqarp")) {
                 ast = new PoliqarpPlusTree(query);
-            } else if (ql.toLowerCase().equals("cosmas2")) {
+            } else if (ql.equalsIgnoreCase("cosmas2")) {
                 ast = new CosmasTree(query);
-            } else if (ql.toLowerCase().equals("poliqarpplus")) {
+            } else if (ql.equalsIgnoreCase("poliqarpplus")) {
                 ast = new PoliqarpPlusTree(query);
-            } else if (ql.toLowerCase().equals("cql")) {
+            } else if (ql.equalsIgnoreCase("cql")) {
 //                queryLanguageVersion = "1.2"; // set me
                 ast = new CQLTree(query, version);
-            } else if (ql.toLowerCase().equals("annis")) {
+            } else if (ql.equalsIgnoreCase("annis")) {
                 ast = new AqlTree(query);
             } else {
                 throw new QueryException(ql + " is not a supported query language!");
@@ -150,10 +150,13 @@
         return setQuery(query, ql, "");
     }
 
-    public final String build() {
+    public final String toJSON() {
         return JsonUtils.toJSON(raw());
     }
 
+    public final Map build() {
+        return raw();
+    }
 
     private Map raw() {
         Map<String, Object> requestMap = ast.getRequestMap();
