diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/VirtualCorpusDto.java b/full/src/main/java/de/ids_mannheim/korap/dto/VirtualCorpusDto.java
index f75d5d6..f69f19d 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/VirtualCorpusDto.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/VirtualCorpusDto.java
@@ -12,8 +12,8 @@
     private String type;
     private String status;
     private String description;
-    private String access;
+    private String requiredAccess;
     private String createdBy;
     
     private int numberOfDoc;
-}
+    private String koralQuery;}
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java b/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
index 8aa7a6e..e05f203 100644
--- a/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/dto/converter/VirtualCorpusConverter.java
@@ -19,10 +19,11 @@
         dto.setId(vc.getId());
         dto.setName(vc.getName());
         dto.setCreatedBy(vc.getCreatedBy());
-        dto.setAccess(vc.getRequiredAccess().name());
+        dto.setRequiredAccess(vc.getRequiredAccess().name());
         dto.setStatus(vc.getStatus());
         dto.setDescription(vc.getDescription());
         dto.setType(vc.getType().displayName());
+        dto.setKoralQuery(vc.getCollectionQuery());
 
         JsonNode node = JsonUtils.readTree(statistics);
         int numberOfDoc = node.at("/documents").asInt();
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
index 03c7091..921ee60 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
@@ -26,6 +26,7 @@
 import de.ids_mannheim.korap.user.User.CorpusAccess;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
+import de.ids_mannheim.korap.utils.ParameterChecker;
 import de.ids_mannheim.korap.web.SearchKrill;
 import de.ids_mannheim.korap.web.controller.VirtualCorpusController;
 import de.ids_mannheim.korap.web.input.VirtualCorpusJson;
@@ -54,11 +55,14 @@
     @Autowired
     private VirtualCorpusConverter converter;
 
-    public void storeVC (VirtualCorpusJson vc, String username)
+    public void createVC (VirtualCorpusJson vc, String username)
             throws KustvaktException {
-
+        
+        ParameterChecker.checkObjectValue(vc.getType(), "type");
+        
         User user = authManager.getUser(username);
         // EM: how about VirtualCorpusType.PUBLISHED?
+        
         if (vc.getType().equals(VirtualCorpusType.PREDEFINED)
                 && !user.isAdmin()) {
             throw new KustvaktException(StatusCodes.AUTHORIZATION_FAILED,
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index cfef7fb..8cab1af 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -56,9 +56,9 @@
     private VirtualCorpusService service;
 
     @POST
-    @Path("store")
+    @Path("create")
     @Consumes("application/json")
-    public Response storeVC (@Context SecurityContext securityContext,
+    public Response createVC (@Context SecurityContext securityContext,
             VirtualCorpusJson vc) {
         try {
             jlog.debug(vc.toString());
@@ -67,7 +67,7 @@
             TokenContext context =
                     (TokenContext) securityContext.getUserPrincipal();
 
-            service.storeVC(vc, context.getUsername());
+            service.createVC(vc, context.getUsername());
         }
         catch (KustvaktException e) {
             throw responseHandler.throwit(e);
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java b/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
index 58379e9..76a55ac 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/input/VirtualCorpusJson.java
@@ -1,15 +1,26 @@
 package de.ids_mannheim.korap.web.input;
 
+
 import de.ids_mannheim.korap.constant.VirtualCorpusType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.service.VirtualCorpusService;
 import de.ids_mannheim.korap.utils.ParameterChecker;
+import de.ids_mannheim.korap.web.controller.VirtualCorpusController;
 import lombok.Getter;
 import lombok.Setter;
 
+/** Java POJO of JSON input of the virtual corpus service for 
+ * creating virtual corpora.
+ * 
+ * @author margaretha
+ * @see VirtualCorpusController#createVC(javax.ws.rs.core.SecurityContext, VirtualCorpusJson)
+ * @see VirtualCorpusService#createVC(VirtualCorpusJson, String)
+ */
 @Getter
 @Setter
 public class VirtualCorpusJson {
 
+    // required
     private String name;
     private VirtualCorpusType type;
     private String createdBy;
@@ -20,6 +31,11 @@
     private String description;
     private String status;
 
+    public void setType (VirtualCorpusType type) throws KustvaktException {
+        ParameterChecker.checkObjectValue(type, "VirtualCorpusType");
+        this.type = type;
+    }
+
     public void setName (String name) throws KustvaktException {
         ParameterChecker.checkStringValue(name, "name");
         this.name = name;
diff --git a/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql b/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
index bad2b01..70becc8 100644
--- a/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
+++ b/full/src/main/resources/db/insert/V3.1__insert_virtual_corpus.sql
@@ -45,11 +45,11 @@
 -- virtual corpora
 INSERT INTO virtual_corpus(name, type, required_access, created_by, description, status, collection_query) 
 	VALUES ("dory VC", "PRIVATE", "FREE", "dory", "test vc", "experimental",
-	'{"collection":{"@type":"koral:doc","value":"GOE","match":"match:eq","key":"corpusSigle"}}');
+	'{"collection": { "@type": "koral:docGroup", "operands": [ { "@type": "koral:doc", "key": "corpusSigle", "match": "match:eq", "value": "GOE" }, { "@type": "koral:doc", "key": "creationDate", "match": "match:geq", "type": "type:date", "value": "1820" } ], "operation": "operation:and" }}');
 	
 INSERT INTO virtual_corpus(name, type, required_access, created_by, description, status, collection_query) 
 	VALUES ("group VC", "PROJECT", "PUB", "dory", "test vc", "experimental",
-	'{"collection":{"@type":"koral:doc","value":"GOE","match":"match:eq","key":"corpusSigle"}}');
+	'{"collection": { "@type": "koral:docGroup", "operands": [ { "@type": "koral:doc", "key": "corpusSigle", "match": "match:eq", "value": "GOE" }, { "@type": "koral:doc", "key": "creationDate", "match": "match:leq", "type": "type:date", "value": "1810" } ], "operation": "operation:and" }}');
 
 INSERT INTO virtual_corpus(name, type, required_access, created_by, description, status, collection_query) 
 	VALUES ("system VC", "PREDEFINED", "ALL", "system", "test vc", "experimental",
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/service/full/VirtualCorpusServiceTest.java b/full/src/test/java/de/ids_mannheim/korap/web/service/full/VirtualCorpusServiceTest.java
index e467180..3b3bc6e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/service/full/VirtualCorpusServiceTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/service/full/VirtualCorpusServiceTest.java
@@ -66,7 +66,7 @@
                 .get(ClientResponse.class);
         String entity = response.getEntity(String.class);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
-        //        System.out.println(entity);
+                System.out.println(entity);
         JsonNode node = JsonUtils.readTree(entity);
         assertEquals(3, node.size());
     }
@@ -92,12 +92,12 @@
     }
 
     @Test
-    public void testStoreDeleteVC () throws KustvaktException {
+    public void testCreateDeleteVC () throws KustvaktException {
         String json =
                 "{\"name\": \"new vc\",\"type\": \"PRIVATE\",\"createdBy\": "
                         + "\"test class\",\"collectionQuery\": \"corpusSigle=GOE\"}";
 
-        ClientResponse response = resource().path("vc").path("store")
+        ClientResponse response = resource().path("vc").path("create")
                 .header(Attributes.AUTHORIZATION,
                         handler.createBasicAuthorizationHeaderValue(
                                 "test class", "pass"))
@@ -152,7 +152,7 @@
     }
 
     @Test
-    public void testStoreVCWithExpiredToken ()
+    public void testCreateVCWithExpiredToken ()
             throws IOException, KustvaktException {
         String json =
                 "{\"name\": \"new vc\",\"type\": \"PRIVATE\",\"createdBy\": "
@@ -164,7 +164,7 @@
 
         String authToken = reader.readLine();
 
-        ClientResponse response = resource().path("vc").path("store")
+        ClientResponse response = resource().path("vc").path("create")
                 .header(Attributes.AUTHORIZATION,
                         AuthenticationScheme.API.displayName() + " "
                                 + authToken)
@@ -184,12 +184,12 @@
     }
 
     @Test
-    public void testStoreVCUnauthorized () throws KustvaktException {
+    public void testCreateVCUnauthorized () throws KustvaktException {
         String json =
                 "{\"name\": \"new vc\",\"type\": \"PRIVATE\",\"createdBy\": "
-                        + "\"test class\",\"collectionQuery\": \"pubDate eq 1982\"}";
+                        + "\"test class\",\"collectionQuery\": \"creationDate since 1820\"}";
 
-        ClientResponse response = resource().path("vc").path("store")
+        ClientResponse response = resource().path("vc").path("create")
                 .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
                 .entity(json).post(ClientResponse.class);
 
@@ -206,12 +206,35 @@
     }
 
     @Test
-    public void testStoreVCWithWrongType () throws KustvaktException {
+    public void testCreateVCWithoutType () throws KustvaktException {
+        String json =
+                "{\"name\": \"new vc\",\"createdBy\": "
+                        + "\"test class\",\"collectionQuery\": \"creationDate since 1820\"}";
+
+        ClientResponse response = resource().path("vc").path("create")
+                .header(Attributes.AUTHORIZATION,
+                        handler.createBasicAuthorizationHeaderValue(
+                                "test class", "pass"))
+                .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON)
+                .entity(json).post(ClientResponse.class);
+        String entity = response.getEntity(String.class);
+//        System.out.println(entity);
+        assertEquals(Status.BAD_REQUEST.getStatusCode(), response.getStatus());
+
+        JsonNode node = JsonUtils.readTree(entity);
+        assertEquals(StatusCodes.INVALID_ARGUMENT,
+                node.at("/errors/0/0").asInt());
+        assertEquals("type",node.at("/errors/0/1").asText());
+        assertEquals("null",node.at("/errors/0/2").asText());
+    }
+    
+    @Test
+    public void testCreateVCWithWrongType () throws KustvaktException {
         String json =
                 "{\"name\": \"new vc\",\"type\": \"PRIVAT\",\"createdBy\": "
-                        + "\"test class\",\"collectionQuery\": \"pubDate eq 1982\"}";
+                        + "\"test class\",\"collectionQuery\": \"creationDate since 1820\"}";
 
-        ClientResponse response = resource().path("vc").path("store")
+        ClientResponse response = resource().path("vc").path("create")
                 .header(Attributes.AUTHORIZATION,
                         handler.createBasicAuthorizationHeaderValue(
                                 "test class", "pass"))
