diff --git a/pom.xml b/pom.xml
index 1f9be55..3675651 100644
--- a/pom.xml
+++ b/pom.xml
@@ -356,7 +356,7 @@
         <dependency>
             <groupId>de.ids_mannheim.korap</groupId>
             <artifactId>Krill</artifactId>
-            <version>0.55.7</version>
+            <version>0.55.8</version>
             <exclusions>
                 <exclusion>
                     <groupId>org.xerial</groupId>
diff --git a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
index 7441edd..fc8322c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -39,7 +39,7 @@
     // todo: use korap.config to get index location
     public SearchKrill (String path) {
     	
-    	System.out.println("Debug: SearchKrill: path='" + path + "'.");
+//    	System.out.println("Debug: SearchKrill: path='" + path + "'.");
         try {
             if (path.equals(":temp:")) {
                 this.index = new KrillIndex();
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
index bbca24a..0cbbe13 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/ResourceService.java
@@ -521,7 +521,7 @@
         meta.setSpanContext(ctx);
         meta.addEntry("count", pageLength);
         // todo: what happened to cutoff?
-        meta.addEntry("cutoff", cutoff);
+        meta.addEntry("cutOff", cutoff);
         // meta.addMeta(pageIndex, pageInteger, pageLength, ctx, cutoff);
         // fixme: should only apply to CQL queries per default!
         // meta.addEntry("itemsPerResource", 1);
@@ -1093,7 +1093,29 @@
         return Response.ok().build();
     }
 
-
+    // EM: legacy support
+    // should be deprecated after a while
+    @GET
+    @Path("/corpus/{corpusId}/{docId}/{matchId}/matchInfo")
+    public Response getMatchInfo (@Context SecurityContext ctx,
+            @Context Locale locale, @PathParam("corpusId") String corpusId,
+            @PathParam("docId") String docId,
+            @PathParam("matchId") String matchId,
+            @QueryParam("foundry") Set<String> foundries,
+            @QueryParam("layer") Set<String> layers,
+            @QueryParam("spans") Boolean spans) throws KustvaktException {
+    	
+    	String[] ids = docId.split("\\.");
+    	if (ids.length !=2){
+    		throw KustvaktResponseHandler.throwit(
+    				new KustvaktException(StatusCodes.PARAMETER_VALIDATION_ERROR, 
+    				docId + " format is wrong. Expected a fullstop between doc id "
+					+ "and text id"));
+    	}		
+    	return getMatchInfo(ctx, locale, corpusId, ids[0], ids[1], matchId, foundries, layers, spans);
+    	
+    }
+    
     // fixme: only allowed for corpus?!
     @GET
     @Path("/corpus/{corpusId}/{docId}/{textId}/{matchId}/matchInfo")
@@ -1125,7 +1147,14 @@
                     e.string());
             throw KustvaktResponseHandler.throwit(e);
         }
-
+        if (user instanceof DemoUser){
+	        try {
+	            ResourceFinder.searchPublicFiltered(Corpus.class, corpusId);
+	        }
+	        catch (KustvaktException e) {
+	            throw KustvaktResponseHandler.throwit(e);
+	        }
+        }
         String results;
         // fixme: checks for policy matching
         // fixme: currently disabled, due to mishab in foundry/layer spec
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoLegacyServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoLegacyServiceTest.java
new file mode 100644
index 0000000..ce459d9
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoLegacyServiceTest.java
@@ -0,0 +1,94 @@
+package de.ids_mannheim.korap.web.service.full;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import com.fasterxml.jackson.databind.JsonNode;
+import com.sun.jersey.api.client.ClientResponse;
+
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.utils.JsonUtils;
+import de.ids_mannheim.korap.web.service.FastJerseyTest;
+
+public class MatchInfoLegacyServiceTest extends FastJerseyTest {
+
+    @BeforeClass
+    public static void configure () throws Exception {
+        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
+                "de.ids_mannheim.korap.web.filter",
+                "de.ids_mannheim.korap.web.utils");
+    }
+
+
+    @Test
+    public void testGetMatchInfoPublicCorpus () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus").path("GOE").path("AGI.04846")
+                .path("p36875-36876").path("matchInfo")
+                .queryParam("foundry", "*")
+                .get(ClientResponse.class);
+       
+        String entity = response.getEntity(String.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        JsonNode node = JsonUtils.readTree(entity);
+        assertNotNull(node);
+        assertEquals("GOE/AGI/04846", node.at("/textSigle").asText());
+        assertEquals("Zweiter römischer Aufenthalt",
+                node.at("/title").asText());
+        assertEquals("vom Juni 1787 bis April 1788",
+                node.at("/subTitle").asText());
+        assertEquals("Goethe, Johann Wolfgang von",
+                node.at("/author").asText());
+        assertTrue(node.at("/snippet").asText()
+                .startsWith("<span class=\"context-left\"></span>"
+                        + "<span class=\"match\"><span title=\"corenlp/p:ADV\">"
+                        + "<span title=\"opennlp/p:ADV\">"
+                        + "<span title=\"tt/l:fern\">"
+                        ));
+    }
+    
+    @Test
+    public void testGetMatchOnlyUnauthorizeCorpus () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus").path("WPD15").path("B07.51608")
+                .path("p46-57").path("matchInfo").get(ClientResponse.class);
+
+        assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
+                response.getStatus());
+        String entity = response.getEntity(String.class);
+        System.out.println(entity);
+        JsonNode node = JsonUtils.readTree(entity);
+        assertNotNull(node);
+        assertEquals(101, node.at("/errors/0/0").asInt());
+        assertEquals("[Cannot found public resources with ids: [WPD15]]",
+                node.at("/errors/0/2").asText());
+    }
+
+//    @Test
+//    public void testMatchInfoSave () {
+//
+//    }
+//
+//
+//    @Test
+//    public void testMatchInfoDelete () {
+//
+//    }
+//
+//
+//    @Test
+//    public void testGetMatches () {
+//
+//    }
+
+
+    @Override
+    public void initMethod () throws KustvaktException {
+        helper().runBootInterfaces();
+    }
+}
\ No newline at end of file
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
index c3f3724..8ff5794 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/MatchInfoServiceTest.java
@@ -65,10 +65,11 @@
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
 
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
         String entity = response.getEntity(String.class);
 //        System.out.println(entity);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        
         JsonNode node = JsonUtils.readTree(entity);
         assertNotNull(node);
         assertEquals("WPD15/B07/51608", node.at("/textSigle").asText());
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
index 6e4440f..94cc478 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/SearchServiceTest.java
@@ -3,6 +3,7 @@
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Iterator;
 import java.util.Set;
@@ -65,6 +66,30 @@
         assertEquals(6218, node.at("/meta/totalResults").asInt());
     }
 
+
+    @Test
+    public void testSearchQueryWithMeta () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("search").queryParam("q", "[orth=der]")
+                .queryParam("ql", "poliqarp").queryParam("cutoff", "true")
+                .queryParam("count", "5")
+                .queryParam("page", "1")
+                .queryParam("context", "40-t,30-t").get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertTrue(node.at("/meta/cutOff").asBoolean());
+        assertEquals(5, node.at("/meta/count").asInt());
+        assertEquals(0, node.at("/meta/startIndex").asInt());
+        assertEquals("token", node.at("/meta/context/left/0").asText());
+        assertEquals(40, node.at("/meta/context/left/1").asInt());
+        assertEquals(30, node.at("/meta/context/right/1").asInt());
+        assertEquals(-1,node.at("/meta/totalResults").asInt());
+    }
+
+
     @Test
     public void testSearchQueryAuthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -107,6 +132,7 @@
         assertEquals("koral:token", node.at("/query/@type").asText());
     }
 
+
     @Test
     public void testSearchForPublicCorpusWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -124,7 +150,8 @@
         assertNotEquals(0, node.path("matches").size());
         assertEquals(32, node.at("/meta/totalResults").asInt());
     }
-    
+
+
     @Test
     public void testSearchForVirtualCollectionWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -138,12 +165,12 @@
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("koral:docGroup", node.at("/collection/@type").asText());
-        assertEquals("operation:and", node.at("/collection/operation").asText());
+        assertEquals("operation:and",
+                node.at("/collection/operation").asText());
         assertNotEquals(0, node.at("/collection/operands").size());
         assertEquals("corpusSigle",
                 node.at("/collection/operands/0/key").asText());
-        assertEquals("GOE",
-                node.at("/collection/operands/0/value").asText());
+        assertEquals("GOE", node.at("/collection/operands/0/value").asText());
         assertEquals("creationDate",
                 node.at("/collection/operands/1/key").asText());
         assertEquals("1810-01-01",
@@ -151,28 +178,28 @@
         assertEquals(1, node.at("/meta/totalResults").asInt());
     }
 
-    
+
     @Test
-    public void testSearchForPublicCorpusWithIntegerId () throws KustvaktException {
+    public void testSearchForPublicCorpusWithIntegerId ()
+            throws KustvaktException {
         Set<Corpus> publicCorpora = ResourceFinder.searchPublic(Corpus.class);
         Iterator<Corpus> i = publicCorpora.iterator();
         String id = null;
-        while (i.hasNext()){
+        while (i.hasNext()) {
             Corpus c = i.next();
-            if (c.getName().equals("Goethe")){
-                id =c.getId().toString();
+            if (c.getName().equals("Goethe")) {
+                id = c.getId().toString();
             }
         }
-            
+
         ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").path(id).path("search")
-                .queryParam("q", "blau").queryParam("ql", "poliqarp")
-                .get(ClientResponse.class);
-        
+                .path("corpus").path(id).path("search").queryParam("q", "blau")
+                .queryParam("ql", "poliqarp").get(ClientResponse.class);
+
         String ent = response.getEntity(String.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
                 response.getStatus());
-        
+
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("koral:doc", node.at("/collection/@type").asText());
@@ -180,7 +207,8 @@
         assertEquals("GOE", node.at("/collection/value").asText());
         assertNotEquals(0, node.path("matches").size());
     }
-    
+
+
     @Test
     public void testSearchForCorpusWithStringIdUnauthorized () {
         ClientResponse response = resource().path(getAPIVersion())
@@ -195,13 +223,13 @@
         assertEquals("[Cannot found public resources with ids: [WPD15]]",
                 error.get(2).asText());
     }
-    
+
+
     @Test
     public void testSearchForOwnersCorpusWithStringId () {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("corpus").path("WPD15").path("search")
-                .queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
@@ -215,26 +243,28 @@
         assertEquals("WPD15", node.at("/collection/value").asText());
         assertNotEquals(0, node.path("matches").size());
     }
-    
+
+
     @Test
-    public void testSearchForOwnersCorpusWithIntegerId () throws KustvaktException {
-        
-        User kustvaktUser =  ((EntityHandlerIface) helper().getBean(ContextHolder.KUSTVAKT_USERDB))
-            .getAccount("kustvakt");
-        Set<Corpus> userCorpora = ResourceFinder.search(kustvaktUser, Corpus.class);
+    public void testSearchForOwnersCorpusWithIntegerId ()
+            throws KustvaktException {
+
+        User kustvaktUser = ((EntityHandlerIface) helper()
+                .getBean(ContextHolder.KUSTVAKT_USERDB)).getAccount("kustvakt");
+        Set<Corpus> userCorpora = ResourceFinder.search(kustvaktUser,
+                Corpus.class);
         Iterator<Corpus> i = userCorpora.iterator();
         String id = null;
-        while (i.hasNext()){
+        while (i.hasNext()) {
             Corpus c = i.next();
-            if (c.getPersistentID().equals("WPD15")){
-                id =c.getId().toString();
-//                System.out.println("Corpus "+id);
+            if (c.getPersistentID().equals("WPD15")) {
+                id = c.getId().toString();
+                //                System.out.println("Corpus "+id);
             }
         }
         ClientResponse response = resource().path(getAPIVersion())
                 .path("corpus").path(id).path("search")
-                .queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
+                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .get(ClientResponse.class);
@@ -249,6 +279,7 @@
         assertNotEquals(0, node.path("matches").size());
     }
 
+
     @Test
     public void testSearchSentenceMeta () {
         ClientResponse response = resource().path(getAPIVersion())
