diff --git a/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java b/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
index cf87bff..bda1eea 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
@@ -38,8 +38,9 @@
         if (resource == null | !(resource instanceof VirtualCollection))
             return;
         VirtualCollection other = (VirtualCollection) resource;
-        this.setFields(this.getFields() == null ? other.getFields() : this
-                .getFields());
+        if (this.getFields() == null || this.getFields().isEmpty()){
+        	setFields(other.getFields());
+        }
     }
 
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
index 359643a..9dfe0a6 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/CollectionLoader.java
@@ -29,7 +29,7 @@
 
         KustvaktConfiguration config = beans.getConfiguration();
         
-        KoralCollectionQueryBuilder bui = new KoralCollectionQueryBuilder();
+//        KoralCollectionQueryBuilder bui = new KoralCollectionQueryBuilder();
 //        bui.with("creationDate since 1775 & corpusSigle=GOE");
 //
 //        VirtualCollection c1 = new VirtualCollection();
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
index c01fc66..928b490 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
@@ -4,6 +4,8 @@
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.Corpus;
+import de.ids_mannheim.korap.resources.Foundry;
+import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.resources.Permissions;
 import de.ids_mannheim.korap.security.ac.PolicyBuilder;
 import de.ids_mannheim.korap.security.ac.ResourceFinder;
@@ -25,25 +27,26 @@
                 .toUser(KustvaktConfiguration.KUSTVAKT_USER);
         KustvaktConfiguration config =beans.getConfiguration();
         PolicyBuilder builder = new PolicyBuilder(user);
-//        builder.addCondition("public");
-//        builder.setResources(new Corpus("GOE"));
-//        builder.setPermissions(Permissions.Permission.READ);
-//        builder.create();
-
         builder = new PolicyBuilder(user);
         builder.addCondition("public");
         builder.setResources(new Corpus(config.getDefaultVirtualCollectionId()));
         builder.setPermissions(Permissions.Permission.READ);
         builder.create();
 
-//        KustvaktResource tt = new Foundry("tt");
-//        tt.setName("TreeTagger");
-//        tt.setDescription("todo ...");
-//        builder = new PolicyBuilder(user);
-//        builder.addCondition("public");
-//        builder.setResources(tt);
-//        builder.setPermissions(Permissions.Permission.READ);
-//        builder.create();
+        // FIX ME: the following policies are used in test cases and should not be hard coded here.
+        builder.addCondition("public");
+        builder.setResources(new Corpus("GOE"));
+        builder.setPermissions(Permissions.Permission.READ);
+        builder.create();
+        
+        KustvaktResource tt = new Foundry("tt");
+        tt.setName("TreeTagger");
+        tt.setDescription("todo ...");
+        builder = new PolicyBuilder(user);
+        builder.addCondition("public");
+        builder.setResources(tt);
+        builder.setPermissions(Permissions.Permission.READ);
+        builder.create();
     }
 
 
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 afc4851..feee22e 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
@@ -842,16 +842,18 @@
 				cquery.with(query);
 
 			cachetmp = ResourceFactory.getCachedCollection(cquery.toJSON());
-
+			
 			// see if vc was cached!
 			VirtualCollection tmp = resourceHandler.getCache(cachetmp.getId(), VirtualCollection.class);
-
+			
 			// if not cached, fill with stats values
 			if (tmp == null) {
 				String stats = searchKrill.getStatistics(cquery.toJSON());
 				cachetmp.setStats(JsonUtils.readSimple(stats, Map.class));
+				if (query != null && !query.isEmpty())
+					cachetmp.setFields(cquery.toJSON());
 			}
-
+			
 			if (!cache && !User.UserFactory.isDemo(ctx.getUsername())) {
 				collection = ResourceFactory.getPermanentCollection(cachetmp, name, description);
 				vals = collection.toMap();
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
index 9d0bd88..d036b57 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceServiceTest.java
@@ -31,12 +31,14 @@
  * @date 14/01/2016
  */
 public class ResourceServiceTest 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");
+        
+        //containerURI = "https://localhost/";
     }
 
 
@@ -262,67 +264,8 @@
         assertNotEquals(0, node.size());
     }
 
-
     @Test
-    public void testCorpusGet () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").path("WPD").get(ClientResponse.class);
-        String ent = response.getEntity(String.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertTrue(node.isObject());
-        assertEquals("WPD", node.path("id").asText());
-    }
-
-
-    @Test
-    public void testCorpusGet2 () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").path("GOE").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.isObject());
-        assertEquals("GOE", node.path("id").asText());
-    }
-
-
-    @Test
-    @Ignore
-    public void testCorpusGetUnauthorized () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus").path("BRZ20").get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.UNAUTHORIZED.getStatusCode(),
-                response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertTrue(node.isObject());
-        assertNotNull(node);
-    }
-
-
-    @Test
-    public void testFoundryGet () {
-        ClientResponse response = resource().path(getAPIVersion())
-                .path("foundry").path("tt").get(ClientResponse.class);
-        String ent = response.getEntity(String.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertNotEquals(0, node.size());
-    }
-
-
-    @Test
-    public void testResourceStoreAndDelete () throws KustvaktException {
+    public void testResourceStore() throws KustvaktException {
     	// resource store service
         ClientResponse response = resource()
                 .path(getAPIVersion())
@@ -344,7 +287,9 @@
         assertTrue(node.isObject());
         assertEquals("Goethe", node.path("name").asText());
         assertEquals("Goethe corpus", node.path("description").asText());
-        
+
+        String id = node.path("id").asText();
+        		
         // check if the resource is in the db
         ResourceDao<?> dao = new ResourceDao<>(helper().getContext()
                 .getPersistenceClient());
@@ -352,15 +297,16 @@
                 .getDatabase());
 
         assertNotEquals(0, dao.size());
-        KustvaktResource res = dao.findbyId(node.path("id").asText(),
+        KustvaktResource res = dao.findbyId(id,
                 User.UserFactory.getDemoUser());
         assertNotNull(res);
         Assert.assertEquals("Goethe",res.getName().toString());
     
         // delete resource service
-        response = resource()
+    	response = resource()
                 .path(getAPIVersion())
-                .path("virtualcollection/"+node.path("id").asText())
+                .path("virtualcollection")
+                .path(id)
                 .header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
                 .delete(ClientResponse.class);
@@ -374,16 +320,104 @@
         assertEquals("sqlite", helper().getContext().getPersistenceClient()
                 .getDatabase());
 
-        res = dao.findbyId(node.path("id").asText(),
+        res = dao.findbyId(id,
                 User.UserFactory.getDemoUser());
         assertEquals(null,res);
     }
 
 
     @Test
+    public void testCorpusGet () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus").path("WPD15").get(ClientResponse.class);
+        String ent = response.getEntity(String.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertTrue(node.isObject());
+        assertEquals("WPD15", node.path("id").asText());
+    }
+
+    
+
+//    @Test
+//    public void testCreatePolicyForResource() {
+//    	ClientResponse response = resource()
+//                .path(getAPIVersion())
+//                .path("admin")
+//                .path("createPolicies")
+//                .path(UUID.randomUUID().toString())
+//                .queryParam("type", "virtualcollection")
+//                .queryParam("name", "Goethe")
+//                .queryParam("description", "Goethe corpus")
+//                .queryParam("group", "public")
+//                .queryParam("perm", Permission.READ.name())
+//                .queryParam("loc", "")
+//                .queryParam("expire", "")
+//                .header(Attributes.AUTHORIZATION,
+//                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+//                .post(ClientResponse.class);
+//        
+//        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+//                response.getStatus());
+//        
+//        String ent = response.getEntity(String.class);
+//        JsonNode node = JsonUtils.readTree(ent);
+//        assertNotNull(node);
+//        assertTrue(node.isObject());
+//        assertEquals("GOE", node.path("id").asText());
+//	}
+    
+    @Test
+    public void testCorpusGet2 () {
+    	ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus").path("GOE").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.isObject());
+        assertEquals("GOE", node.path("id").asText());
+    }
+    
+    
+    @Test
+    @Ignore
+    public void testCorpusGetUnauthorized () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("corpus").path("BRZ20").get(ClientResponse.class);
+        assertEquals(ClientResponse.Status.UNAUTHORIZED.getStatusCode(),
+                response.getStatus());
+        String ent = response.getEntity(String.class);
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertTrue(node.isObject());
+        assertNotNull(node);
+    }
+
+    @Test
+    public void testFoundryGet () {
+        ClientResponse response = resource().path(getAPIVersion())
+                .path("foundry").path("tt").get(ClientResponse.class);
+        String ent = response.getEntity(String.class);
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertNotEquals(0, node.size());
+    }
+
+
+    
+
+    @Test
     public void testSerializationQueryWithCorpusThroughFilteredPublic () {
         ClientResponse response = resource().path(getAPIVersion())
-                .path("corpus/WPD/search").queryParam("q", "[orth=der]")
+                .path("corpus/WPD15/search").queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp").queryParam("context", "base/s:s")
                 .method("TRACE", ClientResponse.class);
         String ent = response.getEntity(String.class);
@@ -393,7 +427,7 @@
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
         assertEquals("corpusSigle", node.at("/collection/key").asText());
-        assertEquals("WPD", node.at("/collection/value").asText());
+        assertEquals("WPD15", node.at("/collection/value").asText());
     }
 
 
@@ -401,7 +435,7 @@
     public void testSerializationQueryWithCorpus () {
         ClientResponse response = resource()
                 .path(getAPIVersion())
-                .path("corpus/WPD/search")
+                .path("corpus/WPD15/search")
                 .queryParam("q", "[orth=der]")
                 .queryParam("ql", "poliqarp")
                 .header(Attributes.AUTHORIZATION,
@@ -412,15 +446,35 @@
         String ent = response.getEntity(String.class);
         JsonNode node = JsonUtils.readTree(ent);
         assertNotNull(node);
-        System.out.println("NODE "+node.asText());
         assertEquals("koral:doc", node.at("/collection/@type").asText());
         assertEquals("corpusSigle", node.at("/collection/key").asText());
     }
 
-
     @Test
     public void testSerializationQueryWithCollection () {
-        ClientResponse response = resource()
+    	// Add Virtual Collection
+    	ClientResponse response = resource()
+                .path(getAPIVersion())
+                .path("virtualcollection")
+                .queryParam("filter", "false")
+                .queryParam("name", "Weimarer Werke")
+                .queryParam("description", "Goethe-Werke in Weimar (seit 1775)")
+                .header(Attributes.AUTHORIZATION,
+                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+                .post(ClientResponse.class, "creationDate since 1775 & corpusSigle=GOE");
+        
+        assertEquals(ClientResponse.Status.OK.getStatusCode(),
+                response.getStatus());
+        
+        String ent = response.getEntity(String.class);
+        
+        JsonNode node = JsonUtils.readTree(ent);
+        assertNotNull(node);
+        assertTrue(node.isObject());
+        assertEquals("Weimarer Werke", node.path("name").asText());
+
+        // Get virtual collections
+        response = resource()
                 .path(getAPIVersion())
                 .path("collection")
                 .header(Attributes.AUTHORIZATION,
@@ -428,8 +482,8 @@
                 .get(ClientResponse.class);
         assertEquals(ClientResponse.Status.OK.getStatusCode(),
                 response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
+        ent = response.getEntity(String.class);
+        node = JsonUtils.readTree(ent);
         assertNotNull(node);
 
         Iterator it = node.elements();
