diff --git a/src/main/java/de/ids_mannheim/korap/config/AdminSetup.java b/src/main/java/de/ids_mannheim/korap/config/AdminSetup.java
new file mode 100644
index 0000000..5c0a276
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/config/AdminSetup.java
@@ -0,0 +1,64 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
+
+import java.io.*;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * Created by hanl on 30.05.16.
+ */
+public class AdminSetup {
+
+    private final String token_hash;
+
+    private static AdminSetup setup;
+
+
+    private AdminSetup (String token_hash) {
+        this.token_hash = token_hash;
+    }
+
+
+    public static AdminSetup getInstance () {
+        if (setup == null)
+            setup = init();
+        return setup;
+    }
+
+
+    public String getHash () {
+        return this.token_hash;
+    }
+
+
+    private static AdminSetup init () {
+        EncryptionIface iface = BeansFactory.getKustvaktContext()
+                .getEncryption();
+        String token = iface.createToken();
+        File store = new File("./admin_token");
+        try {
+            String hash = iface.secureHash(token);
+            AdminSetup setup = new AdminSetup(hash);
+            FileOutputStream out = new FileOutputStream(store);
+            out.write(token.getBytes());
+
+            out.close();
+
+            store.setReadable(true, true);
+            store.setWritable(true, true);
+            store.setExecutable(false);
+            System.out
+                    .println("_______________________________________________");
+            System.out.println("Token created. Please make note of it!");
+            System.out.println("Token: " + token);
+            System.out
+                    .println("_______________________________________________");
+            return setup;
+        }
+        catch (Exception e) {
+            throw new RuntimeException("setup failed! ", e);
+        }
+    }
+}
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 5352435..a657c87 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -69,6 +69,7 @@
     // fixme: should move to base config?!
     private EncryptionIface.Encryption encryption;
     private byte[] sharedSecret;
+    @Deprecated
     private String adminToken;
     private int longTokenTTL;
     private int tokenTTL;
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java b/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
index a477d31..3de9412 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
@@ -5,8 +5,10 @@
 import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
 import de.ids_mannheim.korap.interfaces.db.ResourceOperationIface;
 import de.ids_mannheim.korap.resources.Document;
+import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.BooleanUtils;
+import de.ids_mannheim.korap.utils.StringUtils;
 import edu.emory.mathcs.backport.java.util.Collections;
 import org.springframework.dao.DataAccessException;
 import org.springframework.dao.EmptyResultDataAccessException;
@@ -19,12 +21,12 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Set;
 
 /**
  * @author hanl
  * @date 05/11/2014
  */
-// todo: testing!
 // todo: error handling
 public class DocumentDao implements ResourceOperationIface<Document> {
 
@@ -69,13 +71,15 @@
     }
 
 
-    // document id, consisting of corpus sigle, substring key and document number
+    // todo: search for partial matches if entire document is disabled
+    // document id, consisting of corpus sigle, substring key and text number
     @Override
     public Document findbyId (String id, User user) throws KustvaktException {
         MapSqlParameterSource s = new MapSqlParameterSource();
         s.addValue("id", id);
-        //        strftime('%s', created) as created
-        String sql = "select id, persistent_id, disabled, created from doc_store where persistent_id=:id;";
+        s.addValue("docSigle", StringUtils.getDocSigle(id));
+
+        String sql = "select id, persistent_id, disabled, created from doc_store where persistent_id=:id or persistent_id like :docSigle;";
         try {
             return this.jdbcTemplate.queryForObject(sql, s,
                     new RowMapper<Document>() {
@@ -99,6 +103,39 @@
             return null;
         }
         catch (DataAccessException e) {
+            throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
+        }
+    }
+
+
+    @Override
+    public List<Document> findbyPartialId (String id, User user)
+            throws KustvaktException {
+        MapSqlParameterSource s = new MapSqlParameterSource();
+        s.addValue("id", id + "%");
+
+        String sql = "select id, persistent_id, disabled, created from doc_store where persistent_id like :id;";
+        try {
+            return this.jdbcTemplate.query(sql, s, new RowMapper<Document>() {
+                @Override
+                public Document mapRow (ResultSet rs, int rowNum)
+                        throws SQLException {
+                    Document doc = null;
+                    if (!rs.isClosed()) {
+                        doc = new Document(rs.getString("persistent_id"));
+                        doc.setId(rs.getInt("id"));
+                        doc.setCreated(rs.getLong("created"));
+                        doc.setDisabled(rs.getBoolean("disabled"));
+                    }
+
+                    return doc;
+                }
+            });
+        }
+        catch (EmptyResultDataAccessException em) {
+            return null;
+        }
+        catch (DataAccessException e) {
             e.printStackTrace();
             throw new KustvaktException(StatusCodes.CONNECTION_ERROR);
         }
@@ -136,13 +173,14 @@
     }
 
 
+    //todo: remove and introduce partial match search of persistent id!
+    @Deprecated
     public List<Document> findbyCorpus (String corpus, int offset, int index)
             throws KustvaktException {
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("corpus", corpus + "%");
         source.addValue("offset", (offset * index));
         source.addValue("limit", offset);
-        //strftime('%s', created) as
         final String sql = "select id, persistent_id, disabled, created from doc_store where (persistent_id like :corpus) limit :offset, :limit";
         try {
             return this.jdbcTemplate.query(sql, source,
@@ -174,6 +212,7 @@
     }
 
 
+    @Deprecated
     public List<String> findbyCorpus (String corpus, boolean disabled)
             throws KustvaktException {
         MapSqlParameterSource s = new MapSqlParameterSource();
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java b/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
index aeeb58a..41b1c72 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
@@ -151,6 +151,13 @@
 
 
     @Override
+    public <T1 extends KustvaktResource> List<T1> findbyPartialId (String id,
+            User user) throws KustvaktException {
+        return null;
+    }
+
+
+    @Override
     public int storeResource (T resource, User user) throws KustvaktException {
         MapSqlParameterSource source = new MapSqlParameterSource();
         KeyHolder holder = new GeneratedKeyHolder();
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
index 7007fb8..7bd092d 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
@@ -23,20 +23,21 @@
      * @throws java.security.NoSuchAlgorithmException
      * @throws java.io.UnsupportedEncodingException
      */
-    public String produceSecureHash (String input, String salt)
+    public String secureHash (String input, String salt)
             throws NoSuchAlgorithmException, UnsupportedEncodingException,
             KustvaktException;
 
 
-    public String produceSecureHash (String input)
-            throws NoSuchAlgorithmException, UnsupportedEncodingException,
-            KustvaktException;
+    public String secureHash (String input) throws NoSuchAlgorithmException,
+            UnsupportedEncodingException, KustvaktException;
 
 
-    public String hash (String text, String salt) throws Exception;
+    //@Deprecated
+    //public String hash (String text, String salt) throws Exception;
 
 
-    public String hash (String text) throws Exception;
+    //@Deprecated
+    //public String hash (String text) throws Exception;
 
 
     /**
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
index f13e254..43124a0 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/ResourceOperationIface.java
@@ -8,6 +8,7 @@
 
 import java.util.Collection;
 import java.util.List;
+import java.util.Set;
 
 // todo: for transaction to work this should go into core module!?!
 // todo: user instance only required for auditing pointcut operations
@@ -22,6 +23,11 @@
             throws KustvaktException;
 
 
+    // todo: regex should be considered here to consider determination of partial id offset information
+    <T extends KustvaktResource> List<T> findbyPartialId (String id, User user)
+            throws KustvaktException;
+
+
     List<T> getResources (Collection<Object> ids, User user)
             throws KustvaktException;
 
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
index 96d5c52..3d56eff 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultEncryption.java
@@ -28,7 +28,7 @@
 
 
     @Override
-    public String produceSecureHash (String input, String salt)
+    public String secureHash (String input, String salt)
             throws NoSuchAlgorithmException, UnsupportedEncodingException,
             KustvaktException {
         return null;
@@ -36,21 +36,8 @@
 
 
     @Override
-    public String produceSecureHash (String input)
-            throws NoSuchAlgorithmException, UnsupportedEncodingException,
-            KustvaktException {
-        return null;
-    }
-
-
-    @Override
-    public String hash (String text, String salt) throws Exception {
-        return null;
-    }
-
-
-    @Override
-    public String hash (String value) {
+    public String secureHash (String input) throws NoSuchAlgorithmException,
+            UnsupportedEncodingException, KustvaktException {
         return null;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
index f45437e..057583e 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/KustvaktEncryption.java
@@ -78,13 +78,13 @@
     }
 
 
-    public String produceSecureHash (String input) {
-        return produceSecureHash(input, "");
+    public String secureHash (String input) {
+        return secureHash(input, "");
     }
 
 
     @Override
-    public String produceSecureHash (String input, String salt) {
+    public String secureHash (String input, String salt) {
         String hashString = "";
         switch (config.getEncryption()) {
             case ESAPICYPHER:
@@ -124,6 +124,7 @@
     }
 
 
+
     public String hash (String text, String salt) throws Exception {
         byte[] bytes;
 
@@ -143,7 +144,6 @@
     }
 
 
-    @Override
     public String hash (String input) {
         String hashString = "";
         MessageDigest md;
@@ -244,7 +244,7 @@
         String pw = "";
         switch (config.getEncryption()) {
             case ESAPICYPHER:
-                pw = produceSecureHash(plain, salt);
+                pw = secureHash(plain, salt);
                 break;
             case BCRYPT:
                 try {
@@ -265,7 +265,7 @@
     public boolean checkHash (String plain, String hash) {
         switch (config.getEncryption()) {
             case ESAPICYPHER:
-                return produceSecureHash(plain).equals(hash);
+                return secureHash(plain).equals(hash);
             case BCRYPT:
                 try {
                     return BCrypt.checkpw(plain, hash);
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
index fc47c8b..649f58d 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/DocMatchRewrite.java
@@ -35,9 +35,10 @@
     }
 
 
+    //todo: benchmark: see if retrieval and and get docs for all ids at once is better --> outside this rewrite handler
     @Override
     public JsonNode rewriteResult (KoralNode node) throws KustvaktException {
-        Document doc = null;
+        Document doc;
         if (this.docDao == null)
             throw new RuntimeException("Document dao must be set!");
 
diff --git a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
index 3ede387..468fa9e 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/rewrite/RewriteHandler.java
@@ -139,7 +139,6 @@
     }
 
 
-
     public void clear () {
         this.node_processors.clear();
         this.query_processors.clear();
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Document.java b/src/main/java/de/ids_mannheim/korap/resources/Document.java
index c603011..c30e7d1 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/Document.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/Document.java
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.resources;
 
+import bsh.StringUtil;
+import de.ids_mannheim.korap.utils.StringUtils;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -14,30 +16,31 @@
 
     private String corpus;
     private boolean disabled;
+    private String docSigle;
 
 
-    public Document (String persistentID) {
+    public Document (String textSigle) {
+        this.setPersistentID(textSigle);
+        this.docSigle = StringUtils.getDocSigle(textSigle);
+        this.corpus = StringUtils.getCorpusSigle(textSigle);
+    }
+
+
+    public Document (String docSigle, String textSigle) {
         this.setId(-1);
-        this.setPersistentID(persistentID);
-        this.corpus = getCorpusID();
+        this.setPersistentID(textSigle);
+        this.docSigle = docSigle;
+        this.corpus = StringUtils.getCorpusSigle(textSigle);
         this.setDisabled(true);
     }
 
 
-    public Document (String persistentID, boolean disabled) {
-        this(persistentID);
+    public Document (String docsigle, String textSigle, boolean disabled) {
+        this(docsigle, textSigle);
         this.setDisabled(disabled);
     }
 
 
-    private String getCorpusID () {
-        //WPD_SSS.07367
-        if (this.getPersistentID() != null)
-            return this.getPersistentID().split("_")[0];
-        return null;
-    }
-
-
     public boolean isText () {
         return this.getPersistentID().contains(".");
     }
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/APIAuthentication.java b/src/main/java/de/ids_mannheim/korap/security/auth/APIAuthentication.java
index 69ef5bf..977f797 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/APIAuthentication.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/APIAuthentication.java
@@ -11,6 +11,7 @@
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.NamingUtils;
+import de.ids_mannheim.korap.utils.StringUtils;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
@@ -46,7 +47,7 @@
         Element ein = invalided.get(authToken);
         if (e == null && ein == null) {
             try {
-                authToken = NamingUtils.stripTokenType(authToken);
+                authToken = StringUtils.stripTokenType(authToken);
                 context = signedToken.getTokenContext(authToken);
                 context.setTokenType(Attributes.API_AUTHENTICATION);
             }
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java b/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
index ccad916..8c1ad22 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/BasicHttpAuth.java
@@ -12,6 +12,7 @@
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.NamingUtils;
+import de.ids_mannheim.korap.utils.StringUtils;
 import org.apache.commons.codec.binary.Base64;
 import org.apache.oltu.oauth2.common.utils.OAuthUtils;
 
@@ -25,17 +26,6 @@
 
     public static String[] decode (String token) {
         return OAuthUtils.decodeClientAuthenticationHeader(token);
-
-        //        String t = StringUtils.getTokenType(token);
-        //        if (t != null && t.toUpperCase()
-        //                .equals(Attributes.BASIC_AUTHENTICATION.toUpperCase())) {
-        //            token = StringUtils.stripTokenType(token);
-        //            String[] sp = new String(Base64.decodeBase64(token)).split(":", 2);
-        //            sp[0].replaceAll(" ", "");
-        //            sp[1].replaceAll(" ", "");
-        //            return sp;
-        //        }
-        //        return null;
     }
 
 
@@ -68,7 +58,7 @@
             c.setTokenType(Attributes.BASIC_AUTHENTICATION);
             // todo: for production mode, set true
             c.setSecureRequired(false);
-            c.setToken(NamingUtils.stripTokenType(authToken));
+            c.setToken(StringUtils.stripTokenType(authToken));
             //            fixme: you can make queries, but user sensitive data is off limits?!
             c.addContextParameter(Attributes.SCOPES,
                     Scopes.Scope.search.toString());
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
index 5c98f8f..f7387c4 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
@@ -14,6 +14,7 @@
 import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.NamingUtils;
+import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
 import net.sf.ehcache.Cache;
 import net.sf.ehcache.CacheManager;
@@ -79,7 +80,7 @@
         jlog.info("getting session status of token type '{}'",
                 token.split(" ")[0]);
         AuthenticationIface provider = getProvider(
-                NamingUtils.getTokenType(token), null);
+                StringUtils.getTokenType(token), null);
 
         if (provider == null)
             // throw exception for missing type paramter
@@ -398,7 +399,7 @@
                     StatusCodes.PASSWORD_RESET_FAILED);
 
         try {
-            user.setPassword(crypto.produceSecureHash(newPassword));
+            user.setPassword(crypto.secureHash(newPassword));
         }
         catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
             //            throw new KorAPException(StatusCodes.ILLEGAL_ARGUMENT,
@@ -431,7 +432,7 @@
         }
 
         try {
-            safePass = crypto.produceSecureHash(safePass);
+            safePass = crypto.secureHash(safePass);
         }
         catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
             jlog.error("Encoding/Algorithm Error", e);
@@ -514,7 +515,7 @@
                 (String) safeMap.get(Attributes.PASSWORD), Attributes.PASSWORD);
         String hash;
         try {
-            hash = crypto.produceSecureHash(safePass);
+            hash = crypto.secureHash(safePass);
         }
         catch (UnsupportedEncodingException | NoSuchAlgorithmException e) {
             jlog.error("Encryption error", e);
@@ -789,7 +790,7 @@
 
     private String cache_key (String input) throws KustvaktException {
         try {
-            return crypto.hash(KEY + "@" + input);
+            return crypto.secureHash(KEY + "@" + input);
         }
         catch (Exception e) {
             jlog.error("illegal cache key input '{}'", input);
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/OpenIDconnectAuthentication.java b/src/main/java/de/ids_mannheim/korap/security/auth/OpenIDconnectAuthentication.java
index e8de6c7..9515c93 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/OpenIDconnectAuthentication.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/OpenIDconnectAuthentication.java
@@ -12,6 +12,7 @@
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.NamingUtils;
+import de.ids_mannheim.korap.utils.StringUtils;
 import net.sf.ehcache.CacheManager;
 import net.sf.ehcache.Element;
 import org.springframework.cache.annotation.CacheEvict;
@@ -41,7 +42,7 @@
     @Override
     public TokenContext getUserStatus (String authToken)
             throws KustvaktException {
-        authToken = NamingUtils.stripTokenType(authToken);
+        authToken = StringUtils.stripTokenType(authToken);
         return this.database.getContext(authToken);
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
index 86ac337..4744e07 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/KoralCollectionQueryBuilder.java
@@ -92,7 +92,10 @@
     }
 
 
-    public Object rebaseCollection () {
+    public Object rebaseCollection (JsonNode node) {
+        if (node != null)
+            return mergeWith(node);
+
         if (this.builder.length() == 0 && this.base == null)
             return null;
 
@@ -125,18 +128,26 @@
 
     public JsonNode mergeWith (JsonNode node) {
         if (this.base != null) {
-            // check that collection non empty
             if (node != null) {
                 JsonNode tobase = node.at("/collection");
                 JsonNode base = this.base.deepCopy();
-                JsonNode result = JsonBuilder.buildDocGroup("and",
-                        base.at("/collection"), tobase);
+                JsonNode result = base.at("/collection");
+
+                if (result.isMissingNode() && !tobase.isMissingNode())
+                    result = tobase;
+                else if (result.isMissingNode() && tobase.isMissingNode())
+                    return base;
+                else {
+                    result = JsonBuilder.buildDocGroup(
+                            this.mergeOperator != null ? this.mergeOperator
+                                    .toLowerCase() : "and", result, tobase);
+                }
                 ((ObjectNode) base).put("collection", result);
                 return base;
             }
-            return null;
+            return this.base;
         }
-        return null;
+        throw new RuntimeException("no query found to merge with!");
     }
 
 
@@ -160,7 +171,12 @@
 
 
     public String toJSON () {
-        return JsonUtils.toJSON(rebaseCollection());
+        return JsonUtils.toJSON(rebaseCollection(null));
+    }
+
+
+    public String mergeToJSON (JsonNode node) {
+        return JsonUtils.toJSON(rebaseCollection(node));
     }
 
 
@@ -170,22 +186,6 @@
     }
 
 
-    @Deprecated
-    private KoralCollectionQueryBuilder appendToBaseGroup (JsonNode node) {
-        if (base.at("/collection/@type").asText().equals("koral:docGroup")) {
-            ArrayNode group = (ArrayNode) base.at("/collection/operands");
-            if (node instanceof ArrayNode)
-                group.addAll((ArrayNode) node);
-            else
-                group.add(node);
-        }
-        else
-            throw new IllegalArgumentException("No group found to add to!");
-        // fixme: if base is a doc only, this function is not supported. requirement is a koral:docGroup, since
-        // combination operator is unknown otherwise
-        return this;
-    }
-
     private static class JsonBuilder {
 
         public static ObjectNode buildDoc (String key, String value) {
diff --git a/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java b/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
index 52f8663..beafb32 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/NamingUtils.java
@@ -10,62 +10,10 @@
  */
 public class NamingUtils {
 
-    private static final String SLASH = "/";
 
 
     private NamingUtils () {}
 
 
-    public static Collection<String> joinStringSet (Collection<String> source,
-            String other) {
-        Set<String> set = new HashSet<>(source);
-        set.add(other);
-        return set;
-    }
-
-
-    public static Collection<UUID> joinUUIDSet (Collection<UUID> source,
-            UUID other) {
-        Set<UUID> set = new HashSet<>(source);
-        set.add(other);
-        return set;
-    }
-
-
-    public static String joinResources (String first, String second) {
-        String res;
-        if (first != null && !first.isEmpty())
-            res = first + SLASH + second;
-        else
-            res = second;
-        return res.replaceAll("\\s", "");
-    }
-
-
-    public static String[] splitAnnotations (String joined) {
-        String[] spl = joined.split(SLASH);
-        if (spl.length == 2)
-            return spl;
-        else
-            return null;
-    }
-
-
-    public static String stripTokenType (String token) {
-        int idx = token.lastIndexOf(" ");
-        if (idx == -1)
-            return token;
-        return token.substring(idx).replaceAll("\\s", "");
-    }
-
-
-    public static String getTokenType (String token) {
-        if (token.contains(" "))
-            return token.substring(0, token.lastIndexOf(" "))
-                    .replaceAll("\\s", "").toLowerCase();
-        else
-            return null;
-    }
-
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java b/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
index e5ab428..f942250 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/StringUtils.java
@@ -11,6 +11,7 @@
             .getLogger(StringUtils.class);
 
     private static final String SEP = ";";
+    private static final String SLASH = "/";
 
 
     public static Collection<UUID> stringToUUIDList (String s) {
@@ -136,4 +137,72 @@
         return StringEscapeUtils.unescapeHtml(value);
     }
 
+
+    public static String getDocSigle (String textSigle) {
+        if (textSigle != null)
+            return textSigle.split("\\.")[0];
+        return null;
+    }
+
+
+    public static String getCorpusSigle (String textSigle) {
+        //WPD_SSS.07367
+        if (textSigle != null)
+            return textSigle.split("_")[0];
+        return null;
+    }
+
+
+    public static Collection<String> joinStringSet (Collection<String> source,
+            String other) {
+        Set<String> set = new HashSet<>(source);
+        set.add(other);
+        return set;
+    }
+
+
+    public static Collection<UUID> joinUUIDSet (Collection<UUID> source,
+            UUID other) {
+        Set<UUID> set = new HashSet<>(source);
+        set.add(other);
+        return set;
+    }
+
+
+    public static String joinResources (String first, String second) {
+        String res;
+        if (first != null && !first.isEmpty())
+            res = first + SLASH + second;
+        else
+            res = second;
+        return res.replaceAll("\\s", "");
+    }
+
+
+    public static String[] splitAnnotations (String joined) {
+        String[] spl = joined.split(SLASH);
+        if (spl.length == 2)
+            return spl;
+        else
+            return null;
+    }
+
+
+    public static String stripTokenType (String token) {
+        int idx = token.lastIndexOf(" ");
+        if (idx == -1)
+            return token;
+        return token.substring(idx).replaceAll("\\s", "");
+    }
+
+
+    public static String getTokenType (String token) {
+        if (token.contains(" "))
+            return token.substring(0, token.lastIndexOf(" "))
+                    .replaceAll("\\s", "").toLowerCase();
+        else
+            return null;
+    }
+
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java b/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
index 4bc7055..70207fe 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/UserPropertyReader.java
@@ -73,7 +73,7 @@
                 throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT);
 
             try {
-                pass = crypto.produceSecureHash(pass);
+                pass = crypto.secureHash(pass);
             }
             catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
                 throw new KustvaktException(StatusCodes.REQUEST_INVALID);
@@ -93,7 +93,7 @@
                 throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT);
 
             try {
-                pass = crypto.produceSecureHash(pass);
+                pass = crypto.secureHash(pass);
             }
             catch (NoSuchAlgorithmException | UnsupportedEncodingException e) {
                 throw new KustvaktException(StatusCodes.REQUEST_INVALID);
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
index 29763fa..c06c3fe 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/AdminFilter.java
@@ -4,12 +4,14 @@
 import com.sun.jersey.spi.container.ContainerRequestFilter;
 import com.sun.jersey.spi.container.ContainerResponseFilter;
 import com.sun.jersey.spi.container.ResourceFilter;
+import de.ids_mannheim.korap.config.AdminSetup;
 import de.ids_mannheim.korap.config.BeansFactory;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.NamingUtils;
 import de.ids_mannheim.korap.utils.StringUtils;
-import de.ids_mannheim.korap.web.utils.KorAPContext;
+import de.ids_mannheim.korap.web.utils.KustvaktContext;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
 
 import javax.ws.rs.ext.Provider;
@@ -21,7 +23,6 @@
 @Provider
 public class AdminFilter implements ContainerRequestFilter, ResourceFilter {
 
-    // check over ssl!
     @Override
     public ContainerRequest filter (ContainerRequest cr) {
         // todo:
@@ -31,18 +32,24 @@
         String authentication = cr
                 .getHeaderValue(ContainerRequest.AUTHORIZATION);
 
-        if (authentication != null
-                && authentication.endsWith(BeansFactory.getKustvaktContext()
-                        .getConfiguration().getAdminToken())) {
-            TokenContext c = new TokenContext();
-            c.setUsername(User.ADMINISTRATOR_NAME);
-            c.setTokenType(NamingUtils.getTokenType(authentication));
-            c.setToken(NamingUtils.stripTokenType(authentication));
-            cr.setSecurityContext(new KorAPContext(c));
+        //if (authentication != null
+        //        && authentication.endsWith(BeansFactory.getKustvaktContext()
+        //                .getConfiguration().getAdminToken())) {
+        if (authentication != null && cr.isSecure()) {
+            String token = StringUtils.stripTokenType(authentication);
+            EncryptionIface crypto = BeansFactory.getKustvaktContext()
+                    .getEncryption();
+
+            if (crypto.checkHash(token, AdminSetup.getInstance().getHash())) {
+                TokenContext c = new TokenContext();
+                c.setUsername(User.ADMINISTRATOR_NAME);
+                c.setTokenType(StringUtils.getTokenType(authentication));
+                c.setToken(StringUtils.stripTokenType(authentication));
+                cr.setSecurityContext(new KustvaktContext(c));
+            }
         }
         else
             throw KustvaktResponseHandler.throwAuthenticationException();
-
         return cr;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
index df3157b..194d76d 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/AuthFilter.java
@@ -8,7 +8,7 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.web.utils.KorAPContext;
+import de.ids_mannheim.korap.web.utils.KustvaktContext;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
 
 import javax.ws.rs.ext.Provider;
@@ -50,7 +50,7 @@
                     && context.isValid()
                     && ((context.isSecureRequired() && request.isSecure()) | !context
                             .isSecureRequired()))
-                request.setSecurityContext(new KorAPContext(context));
+                request.setSecurityContext(new KustvaktContext(context));
             else
                 throw KustvaktResponseHandler.throwAuthenticationException();
         }
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
index 107c5e1..708a649 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/DefaultFilter.java
@@ -8,7 +8,7 @@
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import de.ids_mannheim.korap.web.utils.KorAPContext;
+import de.ids_mannheim.korap.web.utils.KustvaktContext;
 
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
@@ -42,8 +42,8 @@
                 // do nothing
             }
             if (pr == null)
-                request.setSecurityContext(new KorAPContext(createShorterToken(
-                        host, ua)));
+                request.setSecurityContext(new KustvaktContext(
+                        createShorterToken(host, ua)));
 
         }
         return request;
diff --git a/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java b/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
index ff77428..2a06655 100644
--- a/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
+++ b/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
@@ -7,7 +7,7 @@
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
 import de.ids_mannheim.korap.config.Attributes;
 import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.web.utils.KorAPContext;
+import de.ids_mannheim.korap.web.utils.KustvaktContext;
 
 import javax.ws.rs.core.SecurityContext;
 import javax.ws.rs.ext.Provider;
@@ -41,7 +41,7 @@
         context.setToken(token);
         context.setTokenType(Attributes.BASIC_AUTHENTICATION);
         context.setUsername("demo");
-        return new KorAPContext(context);
+        return new KustvaktContext(context);
     }
 
 
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 be4593f..ecb1133 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,11 +29,12 @@
                 .toUser(KustvaktConfiguration.KUSTVAKT_USER);
 
         KoralCollectionQueryBuilder bui = new KoralCollectionQueryBuilder();
-        bui.with("creationDate since 1775");
+        bui.with("creationDate since 1775 & corpusSigle=GOE");
 
         VirtualCollection c1 = new VirtualCollection();
         c1.setName("Weimarer Werke");
-        c1.addField(Attributes.QUERY, bui.toJSON());
+
+        c1.setFields(bui.toJSON());
 
         c1.setDescription("Goethe-Werke in Weimar (seit 1775)");
 
@@ -42,7 +43,7 @@
 
         VirtualCollection c2 = new VirtualCollection();
         c2.setName("Aphorismen");
-        c2.addField(Attributes.QUERY, bui.toJSON());
+        c2.setFields(bui.toJSON());
         c2.setDescription("Aphorismentexte Goethes");
 
         bui = new KoralCollectionQueryBuilder();
@@ -50,7 +51,7 @@
 
         VirtualCollection c3 = new VirtualCollection();
         c3.setName("Werther");
-        c3.addField(Attributes.QUERY, bui.toJSON());
+        c3.setFields(bui.toJSON());
         c3.setDescription("Goethe - Die Leiden des jungen Werther");
 
         PolicyBuilder b = new PolicyBuilder(user);
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
index 08fd322..21ac9b8 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
@@ -26,6 +26,7 @@
 import org.joda.time.format.DateTimeFormat;
 import org.joda.time.format.DateTimeFormatter;
 import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.Context;
@@ -42,7 +43,7 @@
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class AdminService {
 
-    private static Logger jlog = KustvaktLogger.getLogger(AdminService.class);
+    private static Logger jlog = LoggerFactory.getLogger(AdminService.class);
     // todo: map in timeutils
     private static DateTimeFormatter dtf = DateTimeFormat
             .forPattern("dd/MM/yyyy");
@@ -136,9 +137,9 @@
     }
 
 
-    //fixme: documentservice?!
     @POST
     @Path("doc/{id}/add")
+    @Deprecated
     public Response addDocument (@PathParam("id") String id) {
         Document document = new Document(id);
         try {
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
index e1648d2..83dee9c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
@@ -11,6 +11,7 @@
 import de.ids_mannheim.korap.web.filter.AdminFilter;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
 import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.*;
 import javax.ws.rs.core.MediaType;
@@ -26,8 +27,7 @@
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class DocumentService {
 
-    private static Logger jlog = KustvaktLogger
-            .getLogger(DocumentService.class);
+    private static Logger jlog = LoggerFactory.getLogger(DocumentService.class);
     private DocumentDao documentDao;
 
 
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 9b04a14..0c54bd8 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
@@ -63,7 +63,6 @@
         this.config = BeansFactory.getKustvaktContext().getConfiguration();
         this.resourceHandler = new ResourceHandler();
         this.searchKrill = new SearchKrill(config.getIndexDir());
-
         UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
         this.graphDBhandler = new ClientsHandler(builder.build());
 
@@ -120,7 +119,7 @@
             @Context Locale locale, @PathParam("type") String type,
             @PathParam("id") String id, @PathParam("child") String child) {
         return getResource(context, locale, type,
-                NamingUtils.joinResources(id, child));
+                StringUtils.joinResources(id, child));
     }
 
 
@@ -275,6 +274,7 @@
     }
 
 
+    // ref query parameter removed!
     @TRACE
     @Path("search")
     public Response buildQuery (@Context Locale locale,
@@ -284,20 +284,21 @@
             @QueryParam("cutoff") Boolean cutoff,
             @QueryParam("count") Integer pageLength,
             @QueryParam("offset") Integer pageIndex,
-            @QueryParam("page") Integer startPage,
-            @QueryParam("ref") String reference, @QueryParam("cq") String cq) {
+            @QueryParam("page") Integer startPage, @QueryParam("cq") String cq) {
         TokenContext ctx = (TokenContext) securityContext.getUserPrincipal();
         QuerySerializer ss;
 
-        User user;
-        try {
-            user = controller.getUser(ctx.getUsername());
-        }
-        catch (KustvaktException e) {
-            throw KustvaktResponseHandler.throwit(e);
-        }
+        //User user;
+        //try {
+        //    user = controller.getUser(ctx.getUsername());
+        //}
+        //catch (KustvaktException e) {
+        //    throw KustvaktResponseHandler.throwit(e);
+        //}
 
         ss = new QuerySerializer().setQuery(q, ql, v);
+        if (cq != null)
+            ss.setCollection(cq);
 
         MetaQueryBuilder meta = new MetaQueryBuilder();
         if (pageIndex != null)
@@ -310,10 +311,10 @@
             meta.setSpanContext(context);
         meta.addEntry("cutOff", cutoff);
 
-        ss.setMeta(meta);
-
-        String query = this.processor.processQuery(ss.toJSON(), user);
-        return Response.ok(query).build();
+        ss.setMeta(meta.raw());
+        //fixme: parsing should be done only in search functions!
+        //String query = this.processor.processQuery(ss.toJSON(), user);
+        return Response.ok(ss.toJSON()).build();
     }
 
 
@@ -331,10 +332,10 @@
      * @return
      */
 
-    //todo: does cq have any sensible worth here?
+    //todo: does cq have any sensible worth here? --> would say no! --> is useful in non type/id scenarios
     @TRACE
     @Path("{type}/{id}/search")
-    public Response buildQuery (@Context Locale locale,
+    public Response buildQueryWithId (@Context Locale locale,
             @Context SecurityContext securityContext,
             @QueryParam("q") String q, @QueryParam("ql") String ql,
             @QueryParam("v") String v, @QueryParam("context") String context,
@@ -342,8 +343,7 @@
             @QueryParam("count") Integer pageLength,
             @QueryParam("offset") Integer pageIndex,
             @QueryParam("page") Integer startPage,
-            @PathParam("type") String type, @PathParam("id") String id,
-            @QueryParam("cq") String cq) {
+            @PathParam("type") String type, @PathParam("id") String id) {
         TokenContext ctx = (TokenContext) securityContext.getUserPrincipal();
         type = StringUtils.normalize(type);
         id = StringUtils.decodeHTML(id);
@@ -363,40 +363,38 @@
             meta.addEntry("cutOff", cutoff);
 
         ss.setMeta(meta.raw());
-        if (cq != null)
-            ss.setCollection(cq);
 
         KoralCollectionQueryBuilder cquery = new KoralCollectionQueryBuilder();
         cquery.setBaseQuery(ss.toJSON());
 
+        String query = "";
+        KustvaktResource resource;
         try {
             User user = controller.getUser(ctx.getUsername());
 
-            //todo: instead of throwing exception, build notification and rewrites into result query
-            KustvaktResource resource;
             if (StringUtils.isInteger(id))
                 resource = this.resourceHandler.findbyIntId(
                         Integer.valueOf(id), user);
             else
                 resource = this.resourceHandler.findbyStrId(id, user,
                         ResourceFactory.getResourceClass(type));
-
-            // todo: test this
-            if (resource instanceof VirtualCollection)
-                cquery.mergeWith(resource.getData());
-            else if (resource instanceof Corpus)
-                cquery.with(Attributes.CORPUS_SIGLE
-                        + resource.getPersistentID());
-
         }
         catch (KustvaktException e) {
-            jlog.error("Exception encountered!", e);
-            //throw KustvaktResponseHandler.throwit(e);
+            //todo: instead of throwing exception, build notification and rewrites into result query
+            jlog.error("Exception encountered!");
+            throw KustvaktResponseHandler.throwit(e);
         }
 
-
-        // todo: policy parsing before return
-        return Response.ok(ss.toJSON()).build();
+        if (resource != null) {
+            if (resource instanceof VirtualCollection)
+                query = cquery.and().mergeToJSON(resource.getData());
+            else if (resource instanceof Corpus) {
+                cquery.and().with(
+                        Attributes.CORPUS_SIGLE + resource.getPersistentID());
+                query = cquery.toJSON();
+            }
+        }
+        return Response.ok(query).build();
     }
 
 
@@ -410,7 +408,7 @@
         // todo: should be possible to add the meta part to the query serialization
         try {
             User user = controller.getUser(ctx.getUsername());
-            jsonld = this.processor.processQuery(jsonld, user);
+            //jsonld = this.processor.processQuery(jsonld, user);
         }
         catch (KustvaktException e) {
             throw KustvaktResponseHandler.throwit(e);
@@ -418,6 +416,7 @@
         jlog.info("Serialized search: {}", jsonld);
 
         String result = searchKrill.search(jsonld);
+        // todo: logging
         KustvaktLogger.QUERY_LOGGER.trace("The result set: {}", result);
         return Response.ok(result).build();
     }
@@ -436,10 +435,8 @@
             @QueryParam("cq") String cq, @QueryParam("engine") String engine) {
         TokenContext context = (TokenContext) securityContext
                 .getUserPrincipal();
-        KoralCollectionQueryBuilder cquery = new KoralCollectionQueryBuilder();
         KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
         User user;
-        // todo: not added to query!!
         try {
             user = controller.getUser(context.getUsername());
         }
@@ -451,10 +448,8 @@
         QuerySerializer serializer = new QuerySerializer();
         serializer.setQuery(q, ql, v);
 
-        // todo: parse for security reasons
-        // todo: remove cq parameter
-        // if (cq != null)
-        //    serializer.setCollection(cq);
+        if (cq != null)
+            serializer.setCollection(cq);
 
         MetaQueryBuilder meta = new MetaQueryBuilder();
         meta.addEntry("startIndex", pageIndex);
@@ -468,8 +463,8 @@
         //        meta.addEntry("itemsPerResource", 1);
         serializer.setMeta(meta.raw());
 
-        //fixme: policy rewrite!
         String query = this.processor.processQuery(serializer.toJSON(), user);
+        //String query = serializer.toJSON();
 
         jlog.info("the serialized query {}", query);
 
@@ -489,7 +484,7 @@
             }
         }
         else
-            result = searchKrill.search(query);
+            result = searchKrill.search(serializer.toJSON());
         KustvaktLogger.QUERY_LOGGER.trace("The result set: {}", result);
         return Response.ok(result).build();
     }
@@ -567,7 +562,7 @@
                 meta.addEntry("cutoff", cutoff);
                 // should only apply to CQL queries
                 //                meta.addEntry("itemsPerResource", 1);
-                s.setMeta(meta);
+                s.setMeta(meta.raw());
 
                 query = s.toJSON();
                 //                PolicyParser parser = new PolicyParser(user);
@@ -633,11 +628,11 @@
 
     @GET
     @Path("{type}/{id}/{child}/stats")
-    public Response getStatisticsbyName (@Context SecurityContext context,
+    public Response getStatisticsbyIdChild (@Context SecurityContext context,
             @Context Locale locale, @PathParam("type") String type,
             @PathParam("id") String id, @PathParam("child") String child) {
         return getStatisticsbyId(context, locale, type,
-                NamingUtils.joinResources(id, child));
+                StringUtils.joinResources(id, child));
     }
 
 
@@ -928,7 +923,7 @@
             @Context Locale locale, @PathParam("type") String type,
             @PathParam("id") String id, @PathParam("child") String child) {
         return deleteResource(context, locale, type,
-                NamingUtils.joinResources(id, child));
+                StringUtils.joinResources(id, child));
     }
 
 
@@ -998,7 +993,7 @@
                     if (!manager.isAllowed())
                         continue;
 
-                    String[] sep = NamingUtils.splitAnnotations(spl);
+                    String[] sep = StringUtils.splitAnnotations(spl);
                     if (spl != null) {
                         f_list.add(sep[0]);
                         l_list.add(sep[1]);
@@ -1035,7 +1030,7 @@
             foundries = new HashSet<>();
             layers = new HashSet<>();
             for (Layer r : resources) {
-                String[] spl = NamingUtils.splitAnnotations(r.getName());
+                String[] spl = StringUtils.splitAnnotations(r.getName());
                 if (spl != null) {
                     foundries.add(spl[0]);
                     layers.add(spl[1]);
@@ -1061,7 +1056,7 @@
 
     // todo:?!
     @POST
-    @Path("match/{id}/save")
+    @Path("match/{id}")
     @Deprecated
     public Response save (@PathParam("{id}") String id,
             @QueryParam("d") String description,
@@ -1093,8 +1088,8 @@
     }
 
 
-    @POST
-    @Path("match/{id}/delete")
+    @DELETE
+    @Path("match/{id}")
     @Deprecated
     public Response remove (@PathParam("{id}") String id,
             @Context SecurityContext context) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java b/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
index b55cb45..7c3b346 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/light/LightService.java
@@ -98,7 +98,7 @@
         meta.addEntry("count", pageLength);
         meta.setSpanContext(context);
         meta.addEntry("cutOff", cutoff);
-        ss.setMeta(meta);
+        ss.setMeta(meta.raw());
         if (cq != null)
             ss.setCollection(cq);
         return Response.ok(processor.processQuery(ss.toJSON(), null)).build();
@@ -138,7 +138,7 @@
                 pageInteger, pageLength, ctx, cutoff);
         if (fields != null && !fields.isEmpty())
             meta.addEntry("fields", fields);
-        serializer.setMeta(meta);
+        serializer.setMeta(meta.raw());
         if (cq != null)
             serializer.setCollection(cq);
 
@@ -212,7 +212,7 @@
             // should only apply to CQL queries
             //                meta.addEntry("itemsPerResource", 1);
             QuerySerializer s = new QuerySerializer().setQuery(query, ql, v)
-                    .setMeta(meta);
+                    .setMeta(meta.raw());
             query = processor.processQuery(s.toJSON(), null);
         }
         String result;
diff --git a/src/main/java/de/ids_mannheim/korap/web/utils/KorAPContext.java b/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktContext.java
similarity index 86%
rename from src/main/java/de/ids_mannheim/korap/web/utils/KorAPContext.java
rename to src/main/java/de/ids_mannheim/korap/web/utils/KustvaktContext.java
index 2424d4b..f34cd43 100644
--- a/src/main/java/de/ids_mannheim/korap/web/utils/KorAPContext.java
+++ b/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktContext.java
@@ -12,12 +12,12 @@
  *       wrapper for REST security context
  * 
  */
-public class KorAPContext implements SecurityContext {
+public class KustvaktContext implements SecurityContext {
 
     private TokenContext user;
 
 
-    public KorAPContext (final TokenContext user) {
+    public KustvaktContext (final TokenContext user) {
         this.user = user;
     }
 
diff --git a/src/main/resources/codes.kustvakt b/src/main/resources/codes.kustvakt
new file mode 100644
index 0000000..01fa0d8
--- /dev/null
+++ b/src/main/resources/codes.kustvakt
@@ -0,0 +1,2 @@
+[{code=100, message=}
+]
\ No newline at end of file
diff --git a/src/main/resources/db/sqlite/V1__Initial_version.sql b/src/main/resources/db/sqlite/V1__Initial_version.sql
index d109779..eaa32ff 100644
--- a/src/main/resources/db/sqlite/V1__Initial_version.sql
+++ b/src/main/resources/db/sqlite/V1__Initial_version.sql
@@ -86,6 +86,7 @@
 CREATE TABLE IF NOT EXISTS doc_store (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 persistent_id VARCHAR(100) UNIQUE,
+doc_sigle VARCHAR(100),
 created BIGINT NOT NULL DEFAULT CURRENT_TIMESTAMP,
 disabled BOOLEAN DEFAULT TRUE
 );
