diff --git a/CHANGES b/CHANGES
index 1145a25..893561a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+0.23 2013-12-05
+        - Error handling corrected in KorapResult.
+	- Json deserializer finished for queries.
+
 0.22 2013-12-04
         - Introduced KorapSearch.
 	- Json deserializer (started).
diff --git a/pom.xml b/pom.xml
index d5e783f..be2f0a2 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,7 @@
 
   <groupId>KorAP-modules</groupId>
   <artifactId>KorAP-lucene-index</artifactId>
-  <version>0.22</version>
+  <version>0.23</version>
   <packaging>jar</packaging>
 
   <name>KorAP-lucene-index</name>
diff --git a/src/main/java/de/ids_mannheim/korap/KorapQuery.java b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
index 2ee0623..b76b7b8 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapQuery.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapQuery.java
@@ -25,6 +25,8 @@
     private String field;
     private ObjectMapper json;
 
+    private String defaultFoundry = "mate/";
+
     // Logger
     private final static Logger log = LoggerFactory.getLogger(KorapQuery.class);
 
@@ -161,7 +163,7 @@
 	    case "=":
 		String value = json.get("@value").asText();
 
-		value = value.replaceFirst("base:", "l:").replaceFirst("orth:", "s:");
+		value = value.replaceFirst("base:", defaultFoundry +"l:").replaceFirst("orth:", "s:");
 	
 		if (json.has("@subtype") && json.get("@subtype").asText().equals("korap:regex")) {
 		    if (value.charAt(0) == '\'' || value.charAt(0) == '"') {
diff --git a/src/main/java/de/ids_mannheim/korap/KorapResult.java b/src/main/java/de/ids_mannheim/korap/KorapResult.java
index 22a66bb..2f8def8 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapResult.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapResult.java
@@ -34,6 +34,10 @@
     // This is KorapMatch instead of KorapResult!
     private final static Logger log = LoggerFactory.getLogger(KorapMatch.class);
 
+    // Empty result
+    public KorapResult () {
+    };
+
     public KorapResult (String query,
 			int startIndex,
 			short itemsPerPage,
diff --git a/src/main/java/de/ids_mannheim/korap/KorapSearch.java b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
index d0be889..9d614ff 100644
--- a/src/main/java/de/ids_mannheim/korap/KorapSearch.java
+++ b/src/main/java/de/ids_mannheim/korap/KorapSearch.java
@@ -28,6 +28,7 @@
     public KorapSearchContext leftContext, rightContext;
     private KorapCollection collection;
     private KorapIndex index;
+    private String error;
 
     {
 	leftContext = new KorapSearchContext();
@@ -76,18 +77,64 @@
 	public KorapSearchContext setLength (int value) {
 	    return this.setLength((short) value);
 	};
+
+	public void fromJSON (JsonNode json) {
+	    String type = json.get(0).asText();
+	    if (type.equals("token")) {
+		this.setToken(true);
+	    }
+	    else if (type.equals("char")) {
+		this.setCharacter(true);
+	    };
+	    this.setLength(json.get(1).asInt());
+	};
     };
 
-    public KorapSearch (String json) {
+
+    public KorapSearch (String jsonString) {
 	ObjectMapper mapper = new ObjectMapper();
 	try {
-	    JsonNode rootNode = mapper.readValue(json, JsonNode.class);
+	    JsonNode json = mapper.readValue(jsonString, JsonNode.class);
 
-	    this.query = new KorapQuery("tokens").fromJSON(rootNode.get("query")).toQuery();
+	    if (json.has("query")) {
+		try {
+		    this.query = new KorapQuery("tokens").fromJSON(json.get("query")).toQuery();
+		}
+		catch (QueryException q) {
+		    this.error = q.getMessage();
+		};
+	    }
+	    else {
+		this.error = "No query defined";
+	    };
+
+	    if (this.error == null) {
+
+		// Defined count
+		if (json.has("count"))
+		    this.setCount(json.get("count").asInt());
+
+		// Defined startIndex
+		if (json.has("startIndex"))
+		    this.setStartIndex(json.get("startIndex").asInt());
+
+		// Defined startPage
+		if (json.has("startPage"))
+		    this.setStartPage(json.get("startPage").asInt());
+
+		// Defined contexts
+		if (json.has("context")) {
+		    JsonNode context = json.get("context");
+		    if (context.has("left"))
+			this.leftContext.fromJSON(context.get("left"));
+		    if (context.has("right"))
+			this.rightContext.fromJSON(context.get("right"));
+
+		};
+	    };
 	}
 	catch (IOException e) {
-	}
-	catch (QueryException e) {
+	    this.error = e.getMessage();
 	};
     };
 
@@ -120,6 +167,17 @@
 	return this;
     };
 
+    public KorapSearch setStartPage (int value) {
+	if (value >= 0) {
+	    this.startIndex = (value * this.getCount()) - this.getCount();
+	}
+	else {
+	    this.startIndex = 0;
+	};
+
+	return this;
+    };
+
     public short getCount () {
 	return this.count;
     };
@@ -129,6 +187,7 @@
     };
 
     public KorapSearch setCount (int value) {
+	// Todo: Maybe update startIndex with known startPage!
 	this.setCount((short) value);
 	return this;
     };
@@ -158,6 +217,12 @@
     };
 
     public KorapResult run (KorapIndex ki) {
+	if (this.error != null) {
+	    KorapResult kr = new KorapResult();
+	    kr.setError(this.error);
+	    return kr;
+	};
+
 	this.getCollection().setIndex(ki);
 	return ki.search(this.getCollection(), this);
     };
diff --git a/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java b/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
index f6b85c7..c995068 100644
--- a/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
+++ b/src/test/java/de/ids_mannheim/korap/query/TestKorapQueryJSON.java
@@ -16,6 +16,8 @@
 @RunWith(JUnit4.class)
 public class TestKorapQueryJSON {
 
+    private String defaultFoundry = "mate/";
+
     @Ignore
     public void queryJSONBsp1 () {
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp1.json").getFile());
@@ -30,7 +32,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp1b.json").getFile());
 
 	// [base=foo]|([base=foo][base=bar]) meta author=Goethe&year=1815
-	assertEquals(sqwi.toQuery().toString(), "spanOr([tokens:l:foo, spanNext(tokens:l:foo, tokens:l:bar)])");
+	assertEquals(sqwi.toQuery().toString(), "spanOr([tokens:"+defaultFoundry+"l:foo, spanNext(tokens:"+defaultFoundry+"l:foo, tokens:"+defaultFoundry+"l:bar)])");
     };
 
 
@@ -39,7 +41,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp2.json").getFile());
 
 	// ([base=foo]|[base=bar])[base=foobar]
-	assertEquals(sqwi.toQuery().toString(), "spanNext(spanOr([tokens:l:foo, tokens:l:bar]), tokens:l:foobar)");
+	assertEquals(sqwi.toQuery().toString(), "spanNext(spanOr([tokens:"+defaultFoundry+"l:foo, tokens:"+defaultFoundry+"l:bar]), tokens:"+defaultFoundry+"l:foobar)");
     };
 
     @Test
@@ -47,7 +49,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp3.json").getFile());
 
 	// shrink({[base=Mann]})
-	assertEquals(sqwi.toQuery().toString(), "shrink(0: {0: tokens:l:Mann})");
+	assertEquals(sqwi.toQuery().toString(), "shrink(0: {0: tokens:"+defaultFoundry+"l:Mann})");
     };
 
     @Test
@@ -55,7 +57,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp4.json").getFile());
 
 	// shrink({[base=foo]}[orth=bar])
-	assertEquals(sqwi.toQuery().toString(), "shrink(0: spanNext({0: tokens:l:foo}, tokens:s:bar))");
+	assertEquals(sqwi.toQuery().toString(), "shrink(0: spanNext({0: tokens:"+defaultFoundry+"l:foo}, tokens:s:bar))");
     };
 
     @Test
@@ -63,7 +65,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp5.json").getFile());
 
 	// shrink(1:[base=Der]{1:[base=Mann]}) 
-	assertEquals(sqwi.toQuery().toString(), "shrink(1: spanNext(tokens:l:Der, {1: tokens:l:Mann}))");
+	assertEquals(sqwi.toQuery().toString(), "shrink(1: spanNext(tokens:"+defaultFoundry+"l:Der, {1: tokens:"+defaultFoundry+"l:Mann}))");
     };
 
     @Test
@@ -71,7 +73,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp6.json").getFile());
 
 	// [base=katze]
-	assertEquals(sqwi.toQuery().toString(), "tokens:l:Katze");
+	assertEquals(sqwi.toQuery().toString(), "tokens:"+defaultFoundry+"l:Katze");
     };
 
     @Ignore
@@ -95,7 +97,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp9.json").getFile());
 
 	// [base=Katze&orth=Katzen]
-	assertEquals(sqwi.toQuery().toString(), "spanNear([tokens:l:Katze, tokens:s:Katzen], -1, false)");
+	assertEquals(sqwi.toQuery().toString(), "spanNear([tokens:"+defaultFoundry+"l:Katze, tokens:s:Katzen], -1, false)");
     };
 
     @Test
@@ -103,7 +105,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp10.json").getFile());
 
 	// [base=Katze][orth=und][orth=Hunde]
-	assertEquals(sqwi.toQuery().toString(), "spanNext(spanNext(tokens:l:Katze, tokens:s:und), tokens:s:Hunde)");
+	assertEquals(sqwi.toQuery().toString(), "spanNext(spanNext(tokens:"+defaultFoundry+"l:Katze, tokens:s:und), tokens:s:Hunde)");
     };
 
     @Ignore
@@ -119,7 +121,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp12.json").getFile());
 
 	// contains(<np>,[base=Mann])
-	assertEquals(sqwi.toQuery().toString(), "spanWithin(<tokens:np />, tokens:l:Mann)");
+	assertEquals(sqwi.toQuery().toString(), "spanWithin(<tokens:np />, tokens:"+defaultFoundry+"l:Mann)");
     };
 
     @Ignore
@@ -159,7 +161,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp16.json").getFile());
 
 	// [(base=bar|base=foo)&orth=foobar]
-	assertEquals(sqwi.toQuery().toString(), "spanNear([spanOr([tokens:l:bar, tokens:l:foo]), tokens:s:foobar], -1, false)");
+	assertEquals(sqwi.toQuery().toString(), "spanNear([spanOr([tokens:"+defaultFoundry+"l:bar, tokens:"+defaultFoundry+"l:foo]), tokens:s:foobar], -1, false)");
     };
 
     @Test
@@ -167,7 +169,7 @@
 	SpanQueryWrapperInterface sqwi = jsonQuery(getClass().getResource("/queries/bsp17.json").getFile());
 
 	// within(<np>,[base=Mann])
-	assertEquals(sqwi.toQuery().toString(), "spanWithin(<tokens:np />, tokens:l:Mann)");
+	assertEquals(sqwi.toQuery().toString(), "spanWithin(<tokens:np />, tokens:"+defaultFoundry+"l:Mann)");
     };
 
     public static String getString (String path) {
diff --git a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
index 0d62975..763697a 100644
--- a/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
+++ b/src/test/java/de/ids_mannheim/korap/search/TestKorapSearch.java
@@ -90,4 +90,65 @@
 	assertEquals(6, kr.totalResults());
 	assertEquals(kr.getMatch(0).getSnippetBrackets(), "... dem [Buchstaben] A ...");
     };
+
+    @Test
+    public void searchJSON () throws IOException {
+
+	// Construct index
+	KorapIndex ki = new KorapIndex();
+	// Indexing test files
+	for (String i : new String[] {"00001", "00002", "00003", "00004", "00005", "00006", "02439"}) {
+	    ki.addDocFile(
+	      getClass().getResource("/wiki/" + i + ".json.gz").getFile(), true
+            );
+	};
+	ki.commit();
+
+	String json = getString(getClass().getResource("/queries/metaquery.json").getFile());
+
+
+	KorapResult kr = new KorapSearch(json).run(ki);
+	assertEquals(29, kr.getTotalResults());
+	assertEquals(5, kr.getItemsPerPage());
+	assertEquals(5, kr.getStartIndex());
+	assertEquals("... a: A ist [der klangreichste] der V ...", kr.getMatch(0).getSnippetBrackets());
+    };
+
+
+    @Test
+    public void searchJSONFailure () throws IOException {
+
+	// Construct index
+	KorapIndex ki = new KorapIndex();
+	// Indexing test files
+	for (String i : new String[] {"00001", "00002", "00003", "00004", "00005", "00006", "02439"}) {
+	    ki.addDocFile(
+	      getClass().getResource("/wiki/" + i + ".json.gz").getFile(), true
+            );
+	};
+	ki.commit();
+
+	KorapResult kr = new KorapSearch("{ query").run(ki);
+
+	assertEquals(0, kr.getTotalResults());
+	assertNotNull(kr.getError());
+    };
+
+
+
+
+    public static String getString (String path) {
+	StringBuilder contentBuilder = new StringBuilder();
+	try {
+	    BufferedReader in = new BufferedReader(new FileReader(path));
+	    String str;
+	    while ((str = in.readLine()) != null) {
+		contentBuilder.append(str);
+	    };
+	    in.close();
+	} catch (IOException e) {
+	    fail(e.getMessage());
+	}
+	return contentBuilder.toString();
+    };
 };
