diff --git a/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java b/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
index bef19a1..d0fba37 100644
--- a/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
+++ b/src/main/java/de/ids_mannheim/korap/query/serialize/CQLTree.java
@@ -1,17 +1,17 @@
 package de.ids_mannheim.korap.query.serialize;
 
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
 import de.ids_mannheim.korap.util.QueryException;
 import org.z3950.zing.cql.*;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
 /**
  * @author margaretha
+ * @date 	23.04.14
  */
 public class CQLTree extends AbstractSyntaxTree {
 
@@ -22,25 +22,23 @@
     private static final String TERM_RELATION_CQL_1_1 = "scr";
     private static final String TERM_RELATION_CQL_1_2 = "=";
     private static final String SUPPORTED_RELATION_EXACT = "exact"; // not in the doc    
-    private static final String OPERATION_OR = "\"operation:or\"";
-    private static final String OPERATION_SEQUENCE = "\"operation:sequence\"";
+    private static final String OPERATION_OR = "operation:or";
+    private static final String OPERATION_SEQUENCE = "operation:sequence";
     private static final String KORAP_CONTEXT = "http://ids-mannheim.de/ns/KorAP/json-ld/v0.1/context.jsonld";
 
     private LinkedHashMap<String, Object> requestMap;
     private String version;
     private boolean isCaseSensitive; // default true
-    private StringBuilder sb;
-
+    
     public CQLTree(String query) throws QueryException {
         this(query, VERSION_1_2, true);
     }
 
     public CQLTree(String query, String version) throws QueryException {
-        this(query, version, true);
+        this(query, version, true);                
     }
 
     public CQLTree(String query, String version, boolean isCaseSensitive) throws QueryException {
-        this.sb = new StringBuilder();
         this.version = version;
         this.isCaseSensitive = isCaseSensitive;
         this.requestMap = new LinkedHashMap<>();
@@ -60,17 +58,8 @@
              throw new QueryException(27, "An empty query is unsupported.");
     	
         CQLNode cqlNode = parseQuerytoCQLNode(query);
-        parseCQLNode(cqlNode);
-        ObjectMapper mapper = new ObjectMapper();
-        JsonNode node;
-        try {
-            node = mapper.readTree(sb.toString());
-        } catch (IOException e) {
-            e.printStackTrace();
-            throw new QueryException("Something went wrong!");
-        }
-        requestMap.put("query", node);
-
+        Map<String,Object> queryMap = parseCQLNode(cqlNode);
+        requestMap.put("query", queryMap);
     }
 
     private CQLNode parseQuerytoCQLNode(String query) throws QueryException {
@@ -90,79 +79,99 @@
         }
     }
 
-    private void parseCQLNode(CQLNode node) throws QueryException {
+    private Map<String,Object> parseCQLNode(CQLNode node) throws QueryException {
         if (node instanceof CQLTermNode) {
-            parseTermNode((CQLTermNode) node);
+            return parseTermNode((CQLTermNode) node);
         } else if (node instanceof CQLAndNode) {
-            parseAndNode((CQLAndNode) node);
+            return parseAndNode((CQLAndNode) node);
         } else if (node instanceof CQLOrNode) {
-            parseOrNode((CQLOrNode) node);
+            return parseOrNode((CQLOrNode) node);
         } else {
             throw new QueryException(48, "Only basic search including term-only " +
                     "and boolean operator queries (AND and OR) are currently supported.");
         }
     }
 
-    private void parseTermNode(CQLTermNode node) throws QueryException {
+    private Map<String,Object> parseTermNode(CQLTermNode node) throws QueryException {
         checkTermNode(node);
         final String term = node.getTerm();
         if ((term == null) || term.isEmpty()) {
             throw new QueryException(27, "An empty term is unsupported.");
         } else if (term.contains(" ")) {
-            writeSequence(term);
+            return writeSequence(term);
         } else {
-            writeTerm(term);
+            return writeTerm(term);
         }
     }
 
-    private void parseAndNode(CQLAndNode node) throws QueryException {
+    private Map<String,Object> parseAndNode(CQLAndNode node) throws QueryException {
         checkBooleanModifier(node);
-        sb.append("{\"@type\":\"korap:group\", \"operation\":");
-        sb.append(OPERATION_SEQUENCE);
-        sb.append(", \"distances\":[{\"@type\":\"korap:distance\", \"key\":\"t\"," +
-                " \"min\":0, \"max\":0}]");
-        sb.append(", \"operands\":[");
-        parseCQLNode(node.getLeftOperand());
-        sb.append(", ");
-        parseCQLNode(node.getRightOperand());
-        sb.append("]}");
+        
+        Map<String, Object> map = new LinkedHashMap<String,Object>();
+        map.put("@type", "korap:group");
+        map.put("operation", OPERATION_SEQUENCE);
+        
+        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+        Map<String, Object> distanceMap = new LinkedHashMap<String,Object>();
+        distanceMap.put("@type", "korap:distance");
+        distanceMap.put("key", "t");
+        distanceMap.put("min", "0");
+        distanceMap.put("max", "0");
+        list.add(distanceMap);
+        map.put("distances", list);
+        
+        List<Map<String, Object>> operandList = new ArrayList<Map<String, Object>>();        
+        operandList.add(parseCQLNode(node.getLeftOperand()));
+        operandList.add(parseCQLNode(node.getRightOperand()));
+        map.put("operands", operandList);
+        
+        return map;
     }
 
-    private void parseOrNode(CQLOrNode node) throws QueryException {
-        checkBooleanModifier(node);
-        sb.append("{\"@type\":\"korap:group\", \"operation\":");
-        sb.append(OPERATION_OR);
-        sb.append(", \"operands\":[");
-        parseCQLNode(node.getLeftOperand());
-        sb.append(", ");
-        parseCQLNode(node.getRightOperand());
-        sb.append("]}");
+    private Map<String,Object> parseOrNode(CQLOrNode node) throws QueryException {
+    	checkBooleanModifier(node);
+    	
+    	Map<String, Object> map = new LinkedHashMap<String,Object>();
+    	map.put("@type", "korap:group");
+        map.put("operation", OPERATION_OR);
+        
+        List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
+        list.add(parseCQLNode(node.getLeftOperand()));
+        list.add(parseCQLNode(node.getRightOperand()));
+        map.put("operands", list);
+        
+    	return map;
     }
 
-    private void writeSequence(String str) {
+    private Map<String, Object> writeSequence(String str) {
+    	Map<String, Object> sequenceMap = new LinkedHashMap<String,Object>();       
+        sequenceMap.put("@type", "korap:group");
+        sequenceMap.put("operation", OPERATION_SEQUENCE);
+        
+        List<Map<String, Object>> termList = new ArrayList<Map<String, Object>>();
         String[] terms = str.split(" ");
-        sb.append("{\"@type\":\"korap:group\", \"operation\":");
-        sb.append(OPERATION_SEQUENCE);
-        sb.append(", \"operands\":[");
-
-        int size = terms.length;
-        for (int i = 0; i < size; i++) {
-            writeTerm(terms[i]);
-            if (i < size - 1)
-                sb.append(", ");
+        for (String term : terms){
+        	termList.add(writeTerm(term));
         }
-
-        sb.append("]}");
+        sequenceMap.put("operands", termList);
+        
+        return sequenceMap;
     }
 
-    private void writeTerm(String term) {
-        sb.append("{\"@type\":\"korap:token\", \"wrap\":{\"@type\":\"korap:term\"");
-        if (!isCaseSensitive) {
-            sb.append(", \"caseInsensitive\":true");
-        }
-        sb.append(", \"key\":");
-        sb.append("\"" + term + "\"");
-        sb.append(", \"layer\":\"orth\", \"match\":\"match:eq\"}}");
+    private Map<String, Object> writeTerm(String term) {   	
+    	Map<String, Object> map = new LinkedHashMap<String,Object>();
+    	map.put("@type", "korap:term");
+    	if (!isCaseSensitive) {
+    		map.put("caseInsensitive","true");
+    	}
+    	map.put("key", term);
+    	map.put("layer", "orth");
+    	map.put("match", "match:eq");
+    	
+    	Map<String, Object> tokenMap = new LinkedHashMap<String,Object>();    	
+    	tokenMap.put("@type", "korap:token");    	
+    	tokenMap.put("wrap", map);
+    	return tokenMap;
     }
 
     private void checkBooleanModifier(CQLBooleanNode node) throws QueryException {
diff --git a/src/test/java/CQLTest.java b/src/test/java/CQLTest.java
index 1f7a88b..2686b03 100644
--- a/src/test/java/CQLTest.java
+++ b/src/test/java/CQLTest.java
@@ -5,7 +5,11 @@
 import org.junit.Test;
 import org.z3950.zing.cql.CQLParseException;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
 import de.ids_mannheim.korap.query.serialize.CQLTree;
+import de.ids_mannheim.korap.query.serialize.CosmasTree;
 import de.ids_mannheim.korap.util.QueryException;
 
 
@@ -13,6 +17,7 @@
 	
 	String query;
 	String version ="1.2";
+	ObjectMapper mapper = new ObjectMapper();
 	
 	@Test
 	public void testExceptions() throws CQLParseException, IOException {
@@ -53,6 +58,27 @@
 	}
 	
 	@Test
+	public void testAndQuery() throws CQLParseException, IOException, QueryException{
+		query="(Sonne) and (scheint)";	
+		String jsonLd = 
+			"{@type : korap:group, operation : operation:sequence, distances:[ "+
+				"{@type : korap:distance, key : t, min : 0, max : 0 } ],"+
+					"operands : ["+
+						"{@type : korap:token, wrap : {@type : korap:term,key : Sonne, layer : orth, match : match:eq}}," + 
+						"{@type : korap:token,wrap : {@type : korap:term,key : scheint,layer : orth,match : match:eq}" +
+					"}]}";
+			
+			CQLTree cqlTree = new CQLTree(query, version);		
+			String serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
+			assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
+			
+		CosmasTree ct = new CosmasTree("Sonne und scheint");
+		serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
+		
+		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
+	}
+	
+	@Test
 	public void testBooleanQuery() throws CQLParseException, IOException, QueryException{		
 		query="((Sonne) or (Mond)) and (scheint)";		
 		String jsonLd = 
@@ -66,7 +92,7 @@
 					"{@type:korap:token, wrap:{@type:korap:term, key:scheint, layer:orth, match:match:eq}}" +
 			"]}";
 		CQLTree cqlTree = new CQLTree(query, version);		
-		String serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		String serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 		
 		
@@ -82,7 +108,7 @@
 					"]}" +
 				"]}";
 		cqlTree = new CQLTree(query, version);		
-		serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 		
 	}
@@ -97,7 +123,7 @@
 			"]}";		
 		
 		CQLTree cqlTree = new CQLTree(query, version);		
-		String serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		String serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 		
 		query="(\"Sonne scheint\") or (Mond)";		
@@ -111,7 +137,7 @@
 			"]}";
 		
 		cqlTree = new CQLTree(query, version);		
-		serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 				
 		query="(\"Sonne scheint\") or (\"Mond scheint\")";		
@@ -127,7 +153,7 @@
 					"]}" +
 				"]}";
 		cqlTree = new CQLTree(query, version);		
-		serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 	}
 	
@@ -136,7 +162,7 @@
 		query = "Sonne";		
 		String jsonLd = "{@type:korap:token, wrap:{@type:korap:term, key:Sonne, layer:orth, match:match:eq}}";		
 		CQLTree cqlTree = new CQLTree(query, version);		
-		String serializedQuery = cqlTree.getRequestMap().get("query").toString();		
+		String serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));		
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 	}
 	
@@ -150,7 +176,7 @@
 			"]}";
 		
 		CQLTree cqlTree = new CQLTree(query, version);		
-		String serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		String serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 		
 		
@@ -163,7 +189,7 @@
 			"]}";
 		
 		cqlTree = new CQLTree(query, version);		
-		serializedQuery = cqlTree.getRequestMap().get("query").toString();
+		serializedQuery = mapper.writeValueAsString(cqlTree.getRequestMap().get("query"));
 		assertEquals(jsonLd.replace(" ", ""), serializedQuery.replace("\"", ""));
 	}	
 }
