diff --git a/src/main/java/de/ids_mannheim/korap/auditing/AuditRecord.java b/src/main/java/de/ids_mannheim/korap/auditing/AuditRecord.java
index 28f915d..8e7169c 100644
--- a/src/main/java/de/ids_mannheim/korap/auditing/AuditRecord.java
+++ b/src/main/java/de/ids_mannheim/korap/auditing/AuditRecord.java
@@ -8,6 +8,7 @@
 import lombok.Setter;
 
 import java.util.Arrays;
+import java.util.Date;
 
 /**
  * @author hanl
@@ -18,7 +19,7 @@
 @Setter
 public class AuditRecord {
 
-    // fixme: handle via status codes
+    // todo: handle via status codes
     @Deprecated
     public enum Operation {
         GET, INSERT, UPDATE, DELETE, CREATE
@@ -100,16 +101,19 @@
         return userAgent + "@" + IP;
     }
 
+    // fixme: add id, useragent
     @Override
     public String toString() {
-        return "Record{" +
-                "account='" + userid + '\'' +
-                ", category=" + category +
-                ", loc='" + loc + '\'' +
-                ", timestamp=" + timestamp +
-                ", status='" + status + '\'' +
-                ", field_1='" + field_1 + '\'' +
-                '}';
+        StringBuilder b = new StringBuilder();
+        b.append(category.toString().toLowerCase() + " audit : ")
+                .append(userid + "@" + new Date(timestamp)).append("\n")
+                .append("Status " + status).append("; ");
+
+        if (this.args != null)
+            b.append("Args " + field_1).append("; ");
+        if (this.loc != null)
+            b.append("Location " + loc).append("; ");
+        return b.toString();
     }
 
     @Override
diff --git a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
index df461e9..42aa8c7 100644
--- a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
@@ -24,18 +24,19 @@
     public static final String KUSTVAKT_AUDITING = "kustvakt_auditing";
     public static final String KUSTVAKT_CONFIG = "kustvakt_config";
 
-    private static BeanHolder beans;
+    private static BeanHolderHelper beans;
 
-    public static void setCustomBeansHolder(BeanHolder holder) {
+    public static void setCustomBeansHolder(BeanHolderHelper holder) {
         ApplicationContext context = beans.context;
         holder.context = context;
         BeanConfiguration.beans = holder;
     }
 
-    public static BeanHolder getBeans() {
+    public static BeanHolderHelper getBeans() {
         return BeanConfiguration.beans;
     }
 
+    @Deprecated
     public static void loadAuthenticationProviders() {
         Set<Class<? extends AuthenticationIface>> set = KustvaktClassLoader
                 .loadSubTypes(AuthenticationIface.class);
@@ -54,6 +55,10 @@
         }
     }
 
+    public static boolean hasContext() {
+        return beans != null;
+    }
+
     public static void loadClasspathContext(String... files) {
         if (beans == null) {
             ApplicationContext context;
@@ -61,7 +66,7 @@
                 context = new ClassPathXmlApplicationContext(config_file);
             else
                 context = new ClassPathXmlApplicationContext(files);
-            BeanConfiguration.beans = new BeanHolder(context);
+            BeanConfiguration.beans = new BeanHolderHelper(context);
         }
     }
 
@@ -69,42 +74,54 @@
         if (beans == null) {
             ApplicationContext context = new FileSystemXmlApplicationContext(
                     "file:" + filepath);
-            BeanConfiguration.beans = new BeanHolder(context);
+            BeanConfiguration.beans = new BeanHolderHelper(context);
         }
     }
+
+    public static void closeApplication() {
+        beans.finish();
+    }
+
     //todo: set response handler
+    @Deprecated
     public static KustvaktResponseHandler getResponseHandler() {
         return null;
     }
 
-    public static class BeanHolder {
+    public static class BeanHolderHelper {
 
         private ApplicationContext context = null;
-        private PluginHandler handler;
+        private DefaultHandler handler;
 
-        public BeanHolder() {
-            this.handler = new PluginHandler();
+        public BeanHolderHelper() {
+            this.handler = new DefaultHandler();
         }
 
-        private BeanHolder(ApplicationContext context) {
+        private BeanHolderHelper(ApplicationContext context) {
             this();
             this.context = context;
         }
 
         protected <T> T getBean(Class<T> clazz) {
-            try {
-                return context.getBean(clazz);
-            }catch (NoSuchBeanDefinitionException e) {
-                return this.handler.getDefault(clazz);
+            if (context != null) {
+                try {
+                    return context.getBean(clazz);
+                }catch (NoSuchBeanDefinitionException e) {
+                    // do nothing
+                }
             }
+            return this.handler.getDefault(clazz);
         }
 
         protected <T> T getBean(String name) {
-            try {
-                return (T) context.getBean(name);
-            }catch (NoSuchBeanDefinitionException e) {
-                return (T) this.handler.getDefault(name);
+            if (context != null) {
+                try {
+                    return (T) context.getBean(name);
+                }catch (NoSuchBeanDefinitionException e) {
+                    // do nothing
+                }
             }
+            return (T) this.handler.getDefault(name);
         }
 
         public AuditingIface getAuditingProvider() {
@@ -131,5 +148,10 @@
             return getBean(KUSTVAKT_ENCRYPTION);
         }
 
+        public void finish() {
+            this.getAuditingProvider().finish();
+            context = null;
+        }
+
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java b/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
similarity index 95%
rename from src/main/java/de/ids_mannheim/korap/config/PluginHandler.java
rename to src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
index 47ddf59..38af9f3 100644
--- a/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/DefaultHandler.java
@@ -8,11 +8,11 @@
  * @author hanl
  * @date 17/06/2015
  */
-public class PluginHandler {
+public class DefaultHandler {
 
     private Map<String, Object> defaults;
 
-    public PluginHandler() {
+    public DefaultHandler() {
         this.defaults = new HashMap<>();
         loadClasses();
     }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java
index 410ecbd..18a616f 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java
@@ -66,4 +66,6 @@
         return this.records;
     }
 
+
+    public abstract void finish();
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
index f44bdab..45e5143 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
@@ -76,4 +76,9 @@
 
     public abstract void confirmRegistration(String uriFragment,
             String username) throws KorAPException;
+
+    @Override
+    public String toString() {
+        return "provider list: " + this.providers.toString();
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
index 01cab35..fb8048b 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
@@ -12,33 +12,33 @@
  * Time: 11:04 AM
  */
 public interface EntityHandlerIface {
-    public UserSettings getUserSettings(Integer userid) throws KorAPException;
+    UserSettings getUserSettings(Integer userid) throws KorAPException;
 
-    public int updateSettings(UserSettings settings) throws KorAPException;
+    int updateSettings(UserSettings settings) throws KorAPException;
 
-    public UserDetails getUserDetails(Integer userid) throws KorAPException;
+    UserDetails getUserDetails(Integer userid) throws KorAPException;
 
-    public int updateUserDetails(UserDetails details) throws KorAPException;
+    int updateUserDetails(UserDetails details) throws KorAPException;
 
-    //    public List<UserQuery> getUserQueries(User user) throws KorAPException;
+    //    List<UserQuery> getUserQueries(User user) throws KorAPException;
 
-    //    public UserQuery getUserQuery(String id) throws KorAPException;
+    //    UserQuery getUserQuery(String id) throws KorAPException;
 
-    //    public void updateUserQueries(User user, List<UserQuery> newOnes) throws KorAPException;
+    //    void updateUserQueries(User user, List<UserQuery> newOnes) throws KorAPException;
 
-    public User getAccount(String username) throws
+    User getAccount(String username) throws
             EmptyResultException, KorAPException;
 
-    public int updateAccount(User user) throws KorAPException;
+    int updateAccount(User user) throws KorAPException;
 
-    public int createAccount(User user) throws KorAPException;
+    int createAccount(User user) throws KorAPException;
 
-    public int deleteAccount(Integer userid) throws KorAPException;
+    int deleteAccount(Integer userid) throws KorAPException;
 
-    public int resetPassphrase(String username, String uriToken,
+    int resetPassphrase(String username, String uriToken,
             String passphrase) throws KorAPException;
 
-    public int activateAccount(String username, String uriToken)
+    int activateAccount(String username, String uriToken)
             throws KorAPException;
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/PersistenceClient.java b/src/main/java/de/ids_mannheim/korap/interfaces/PersistenceClient.java
index 43e0faa..07d53c7 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/PersistenceClient.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/PersistenceClient.java
@@ -9,6 +9,7 @@
 
     private SOURCE source;
     private TYPE type;
+    @Deprecated
     protected String database;
     private InputStream schema;
 
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
index 24bc445..9f5a453 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/defaults/DefaultAuditing.java
@@ -27,7 +27,7 @@
         try {
             File f = new File("logs");
             f.mkdirs();
-            stream = new FileOutputStream(new File(f, "audit.log"));
+            stream = new FileOutputStream(new File(f, "default_audit.log"));
         }catch (FileNotFoundException e) {
             e.printStackTrace();
         }
@@ -37,33 +37,43 @@
     public <T extends AuditRecord> List<T> retrieveRecords(
             AuditRecord.CATEGORY category, DateTime day, DateTime until,
             boolean exact, int limit) {
-        throw new UnsupportedOperationException("operation not supported!");
+        throw new UnsupportedOperationException("Operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(
             AuditRecord.CATEGORY category, User user, int limit) {
-        throw new UnsupportedOperationException("operation not supported!");
+        throw new UnsupportedOperationException("Operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(LocalDate day,
             int hitMax) {
-        throw new UnsupportedOperationException("operation not supported!");
+        throw new UnsupportedOperationException("Operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(String userID,
             LocalDate start, LocalDate end, int hitMax) {
-        throw new UnsupportedOperationException("operation not supported!");
+        throw new UnsupportedOperationException("Operation not supported!");
     }
 
     @Override
     public void apply() {
+        List<AuditRecord> rcs = getRecordsToSave();
         try {
-            for (AuditRecord r : getRecordsToSave())
+            for (AuditRecord r : rcs)
                 stream.write((r.toString() + "\n").getBytes());
+        }catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    @Override
+    public void finish() {
+        try {
             stream.flush();
+            stream.close();
         }catch (IOException e) {
             e.printStackTrace();
         }
diff --git a/src/main/java/de/ids_mannheim/korap/user/Attributes.java b/src/main/java/de/ids_mannheim/korap/user/Attributes.java
index 13303e6..55110f8 100644
--- a/src/main/java/de/ids_mannheim/korap/user/Attributes.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Attributes.java
@@ -43,8 +43,8 @@
     public static final String ACCOUNTLOCK = "accountLock";
     public static final String ACCOUNTLINK = "accountLink";
     public static final String URI = "uri";
-    public static final String URI_FRAGMENT = "URIFragment";
-    public static final String URI_EXPIRATION = "uriExpiration";
+    public static final String URI_FRAGMENT = "uri_fragment";
+    public static final String URI_EXPIRATION = "uri_expiration";
     public static final String PRIVATE_USAGE = "privateUsage";
 
     /**
diff --git a/src/main/java/de/ids_mannheim/korap/user/User.java b/src/main/java/de/ids_mannheim/korap/user/User.java
index 32af973..7de02b4 100644
--- a/src/main/java/de/ids_mannheim/korap/user/User.java
+++ b/src/main/java/de/ids_mannheim/korap/user/User.java
@@ -30,6 +30,7 @@
     private List<UserQuery> queries;
 
     protected User() {
+        this.fields = new ParamFields();
         this.accountCreation = TimeUtils.getNow().getMillis();
         this.isAccountLocked = false;
         this.username = "";
diff --git a/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java b/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java
index da6f630..4d012b2 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java
@@ -3,10 +3,7 @@
 import de.ids_mannheim.korap.query.serialize.CollectionQueryProcessor;
 
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * convenience builder class for collection query
@@ -14,7 +11,6 @@
  * @author hanl
  * @date 16/09/2014
  */
-@Deprecated
 public class CollectionQueryBuilder3 {
 
     private boolean verbose;
@@ -31,14 +27,21 @@
         this.rq = new LinkedList<>();
     }
 
-
     public CollectionQueryBuilder3 addSegment(String field, String value) {
         String f = field + "=" + value;
         this.builder.append(f);
         return this;
     }
 
-    public CollectionQueryBuilder3 add(String query) {
+    /**
+     * element can be a more complex sub query like (textClass=freizeit & corpusID=WPD)
+     *
+     * @param query will be parenthised in order to make sub query element
+     * @return
+     */
+    public CollectionQueryBuilder3 addSub(String query) {
+        if (!query.startsWith("(") && !query.endsWith(")"))
+            query = "(" + query + ")";
         this.builder.append(query);
         return this;
     }
@@ -53,29 +56,33 @@
         return this;
     }
 
-    public CollectionQueryBuilder3 addResource(String collection) {
+    public CollectionQueryBuilder3 addRaw(String collection) {
         try {
-            List v = JsonUtils.read(collection, LinkedList.class);
-            this.rq.addAll(v);
-        } catch (IOException e) {
+            Map v = JsonUtils.read(collection, HashMap.class);
+            v.get("collection");
+        }catch (IOException e) {
             throw new IllegalArgumentException("Conversion went wrong!");
         }
         return this;
     }
 
-    public List getRequest() {
-        List list = new ArrayList();
-        if (!this.rq.isEmpty())
-            list.addAll(this.rq);
-        CollectionQueryProcessor tree = new CollectionQueryProcessor(this.verbose);
+    public Map getRequest() {
+        //todo: adding another resource query doesnt work
+
+        CollectionQueryProcessor tree = new CollectionQueryProcessor(
+                this.verbose);
         tree.process(this.builder.toString());
-        list.add(tree.getRequestMap());
-        return list;
+
+        Map request = tree.getRequestMap();
+        if (!this.rq.isEmpty()) {
+            List coll = (List) request.get("collection");
+            coll.addAll(this.rq);
+        }
+        return request;
     }
 
     public String toJSON() {
         return JsonUtils.toJSON(getRequest());
     }
 
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java b/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java
deleted file mode 100644
index 72e8200..0000000
--- a/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package de.ids_mannheim.korap.web;
-
-import com.sun.grizzly.http.embed.GrizzlyWebServer;
-import com.sun.grizzly.http.servlet.ServletAdapter;
-import com.sun.jersey.spi.container.servlet.ServletContainer;
-import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.utils.KustvaktLogger;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-
-/**
- * @author hanl
- * @date 01/06/2015
- */
-public class Kustvakt {
-
-    private static Integer PORT = -1;
-    private static String CONFIG = null;
-
-    public static void main(String[] args) throws Exception {
-        attributes(args);
-        BeanConfiguration.loadClasspathContext();
-
-        if (CONFIG != null) {
-            BeanConfiguration.getBeans().getConfiguration()
-                    .setPropertiesAsStream(new FileInputStream(new File(CONFIG)));
-
-        }
-        grizzlyServer(PORT);
-    }
-
-    public static void grizzlyServer(int port) throws IOException {
-        if (port == -1)
-            port = BeanConfiguration.getBeans().getConfiguration().getPort();
-        System.out.println("Starting grizzly on port " + port + " ...");
-        GrizzlyWebServer gws = new GrizzlyWebServer(port);
-        ServletAdapter jerseyAdapter = new ServletAdapter();
-        jerseyAdapter
-                .addInitParameter("com.sun.jersey.config.property.packages",
-                        "de.ids_mannheim.korap.web.service");
-        jerseyAdapter.setContextPath("/api");
-        jerseyAdapter.setServletInstance(new ServletContainer());
-
-        gws.addGrizzlyAdapter(jerseyAdapter, new String[] { "/api" });
-        gws.start();
-    }
-
-    private static void attributes(String[] args) {
-        for (int i = 0; i < args.length; i++) {
-            switch ((args[i])) {
-                case "--debug":
-                    KustvaktLogger.DEBUG = true;
-                    break;
-                case "--config":
-                    CONFIG = args[i + 1];
-                    break;
-                case "--port":
-                    PORT = Integer.valueOf(args[i + 1]);
-                    break;
-            }
-        }
-    }
-
-}
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 63605c9..2ac7979 100644
--- a/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
+++ b/src/main/java/de/ids_mannheim/korap/web/SearchKrill.java
@@ -1,14 +1,12 @@
 // Connector to the Lucene Backend
 package de.ids_mannheim.korap.web;
 
-import com.fasterxml.jackson.databind.JsonNode;
 import de.ids_mannheim.korap.Krill;
 import de.ids_mannheim.korap.KrillCollection;
 import de.ids_mannheim.korap.KrillIndex;
 import de.ids_mannheim.korap.response.Match;
 import de.ids_mannheim.korap.response.Result;
 import de.ids_mannheim.korap.util.QueryException;
-import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
 import org.apache.lucene.store.MMapDirectory;
 import org.slf4j.Logger;
@@ -171,54 +169,6 @@
         return km.toJsonString();
     };
 
-    /**
-     * Get statistics on (virtual) collections.
-     *
-     * @param json JSON-LD string with potential meta filters.
-     */
-    @Deprecated
-    public String getStatisticsLegacy (JsonNode json) throws QueryException {
-        qlog.trace(JsonUtils.toJSON(json));
-        System.out.println("THE NODE BEFORE GETTING STATISTICS " + json);
-
-        if (this.index == null) {
-            return "{\"documents\" : -1, error\" : \"No index given\" }";
-        }
-
-        // Create Virtula VCollection from json search
-        KrillCollection kc = new KrillCollection();
-        kc.fromJsonLegacy(json);
-
-        // Set index
-        kc.setIndex(this.index);
-
-        long docs = 0,
-            tokens = 0,
-            sentences = 0,
-            paragraphs = 0;
-
-        // Get numbers from index (currently slow)
-        try {
-            docs = kc.numberOf("documents");
-            tokens = kc.numberOf("tokens");
-            sentences = kc.numberOf("sentences");
-            paragraphs = kc.numberOf("paragraphs");
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-
-	/*
-    KorAPLogger.ERROR_LOGGER.error("Unable to retrieve statistics: {}", e.getMessage());
-	*/
-
-        // Build json response
-        StringBuilder sb = new StringBuilder("{");
-        sb.append("\"documents\":").append(docs).append(",\"tokens\":")
-                .append(tokens).append(",\"sentences\":").append(sentences)
-                .append(",\"paragraphs\":").append(paragraphs).append("}");
-        return sb.toString();
-    }
 
     /**
      * Get statistics on (virtual) collections.
@@ -267,42 +217,6 @@
         return sb.toString();
     }
 
-    /**
-     * Get set relations on field terms of (virtual) collections.
-     *
-     * @param json JSON-LD string with potential meta filters.
-     */
-    @Deprecated
-    public String getTermRelation (String json, String field) {
-        qlog.trace(json);
-
-        if (this.index == null) {
-            return "{\"documents\" : -1, \"error\" : \"No index given\" }";
-        }
-
-        // Create Virtula VCollection from json search
-        KrillCollection kc = new KrillCollection(json);
-
-        // Set index
-        kc.setIndex(this.index);
-        long v = 0L;
-        try {
-            v = kc.numberOf("documents");
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        try {
-            // Get term relations as a json string
-            return kc.getTermRelationJSON(field);
-        } catch (IOException e) {
-            KustvaktLogger.ERROR_LOGGER
-                    .error("Unable to retrieve term relations: {}",
-                            e.getMessage());
-            return "{\"documents\" : -1, \"error\" : \"IO error\" }";
-        }
-    }
-
     public String getMatchId (String type, String docid, String tofrom) {
         return new StringBuilder().append("match-").append(type).append("!")
                 .append(type).append("_").append(docid).append("-")
diff --git a/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseHandler.java b/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseHandler.java
index 7a74506..c35ce5b 100644
--- a/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/web/utils/KustvaktResponseHandler.java
@@ -1,7 +1,6 @@
 package de.ids_mannheim.korap.web.utils;
 
 import de.ids_mannheim.korap.auditing.AuditRecord;
-import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.exceptions.BaseException;
 import de.ids_mannheim.korap.exceptions.KorAPException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
@@ -19,12 +18,18 @@
  */
 public class KustvaktResponseHandler {
 
-    private static AuditingIface auditing = BeanConfiguration.getBeans()
-            .getAuditingProvider();
+    private static AuditingIface auditing;
+
+    public static void init(AuditingIface iface) {
+        if (auditing == null)
+            auditing = iface;
+    }
 
     private static void register(List<AuditRecord> records) {
         if (auditing != null && !records.isEmpty())
             auditing.audit(records);
+        else if (auditing == null)
+            throw new RuntimeException("Auditing handler must be set!");
     }
 
     public static WebApplicationException throwit(BaseException e) {
@@ -53,7 +58,7 @@
     }
 
     private static String buildNotification(BaseException e) {
-        KustvaktResponseHandler.register(e.getRecords());
+        register(e.getRecords());
         return buildNotification(e.getStatusCode(), e.getMessage(),
                 e.getEntity());
     }
@@ -73,5 +78,4 @@
                                 "Basic realm=Kustvakt Authentication Service")
                         .entity(buildNotification(e)).build());
     }
-
 }
diff --git a/src/test/java/ClassLoaderTest.java b/src/test/java/ClassLoaderTest.java
index 4f9e455..207ef81 100644
--- a/src/test/java/ClassLoaderTest.java
+++ b/src/test/java/ClassLoaderTest.java
@@ -1,5 +1,5 @@
 import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.config.PluginHandler;
+import de.ids_mannheim.korap.config.DefaultHandler;
 import de.ids_mannheim.korap.interfaces.AuditingIface;
 import de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing;
 import org.junit.Test;
@@ -18,9 +18,10 @@
 
     @Test
     public void testDefaultCreationThrowsNoException() {
-        PluginHandler pl = new PluginHandler();
+        DefaultHandler pl = new DefaultHandler();
         Object o = pl.getDefault(BeanConfiguration.KUSTVAKT_AUDITING);
         assert o != null;
+        assert o instanceof AuditingIface;
     }
 
     @Test(expected = RuntimeException.class)
diff --git a/src/test/java/RewriteTest.java b/src/test/java/RewriteTest.java
index f06390e..7835ca1 100644
--- a/src/test/java/RewriteTest.java
+++ b/src/test/java/RewriteTest.java
@@ -4,7 +4,10 @@
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
 import de.ids_mannheim.korap.resource.LayerMapper;
 import de.ids_mannheim.korap.resource.RewriteProcessor;
-import de.ids_mannheim.korap.resource.rewrite.*;
+import de.ids_mannheim.korap.resource.rewrite.CollectionCleanupFilter;
+import de.ids_mannheim.korap.resource.rewrite.CollectionConstraint;
+import de.ids_mannheim.korap.resource.rewrite.FoundryInject;
+import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
@@ -37,6 +40,8 @@
         s.setQuery(simple_add_query, "poliqarp");
         String result = processor.process(s.toJSON());
         JsonNode node = JsonUtils.readTree(result);
+
+        assert node != null;
         assert !node.at("/query/wrap/foundry").isMissingNode();
     }
 
@@ -59,6 +64,8 @@
         handler.add(new FoundryInject(config));
         String result = handler.apply(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
+
+        assert node != null;
         assert !node.at("/query/wrap/foundry").isMissingNode();
         assert !node.at("/query/wrap/rewrites").isMissingNode();
         assert node.at("/query/wrap/rewrites/0/@type").asText()
@@ -73,6 +80,8 @@
         handler.add(new FoundryInject(config));
         String result = handler.apply(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
+
+        assert node != null;
         assert node.at("/query/wrap/@type").asText().equals("koral:termGroup");
         assert !node.at("/query/wrap/operands/0/foundry").isMissingNode();
         assert !node.at("/query/wrap/operands/0/rewrites").isMissingNode();
@@ -89,6 +98,7 @@
         String result = handler.apply(s.toJSON(), null);
         JsonNode node = JsonUtils.readTree(result);
 
+        assert node != null;
         assert node.at("/query/wrap/@type").asText().equals("koral:termGroup");
         assert !node.at("/query/wrap/operands/0/operands/0/foundry")
                 .isMissingNode();
@@ -112,6 +122,7 @@
         s.setCollection("textClass=politik & corpusID=WPD");
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
+        assert node != null;
         assert node.at("/collection/operands").size() == 1;
     }
 
@@ -124,6 +135,8 @@
         s.setCollection("corpusID=BRZ13 & corpusID=WPD");
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
+
+        assert node != null;
         assert node.at("/collection/operands").size() == 0;
     }
 
@@ -138,6 +151,7 @@
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
 
+        assert node != null;
         assert node.at("/collection/operands/0/@type").asText()
                 .equals("koral:docGroup");
         assert node.at("/collection/operands/0/operands/0/key").asText()
@@ -156,6 +170,7 @@
                 "(corpusID=BRZ13 & corpusID=WPD) & textClass=Wissenschaft & textClass=Sport");
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
+        assert node != null;
         assert node.at("/collection/@type").asText().equals("koral:docGroup");
         assert node.at("/collection/operands").size() == 2;
         assert node.at("/collection/operands/0/key").asText()
@@ -174,6 +189,7 @@
         s.setCollection("(corpusID=BRZ13 & textClass=Wissenschaft)");
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
+        assert node != null;
         assert node.at("/collection/@type").asText().equals("koral:doc");
     }
 
@@ -188,6 +204,7 @@
                 "(corpusID=BRZ13 & corpusID=WPD) & textClass=Wissenschaft");
         String result = s.toJSON();
         JsonNode node = JsonUtils.readTree(handler.apply(result, null));
+        assert node != null;
         assert node.at("/collection/@type").asText().equals("koral:doc");
         assert node.at("/collection/key").asText().equals("textClass");
     }
diff --git a/src/test/java/FastJerseyTest.java b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
similarity index 98%
rename from src/test/java/FastJerseyTest.java
rename to src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
index c51e62c..f3a0a04 100644
--- a/src/test/java/FastJerseyTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/FastJerseyTest.java
@@ -1,3 +1,5 @@
+package de.ids_mannheim.korap.web.service;
+
 import com.sun.jersey.api.client.Client;
 import com.sun.jersey.api.client.WebResource;
 import com.sun.jersey.api.core.DefaultResourceConfig;
diff --git a/src/test/java/KustvaktCoreRestTest.java b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktCoreRestTest.java
similarity index 97%
rename from src/test/java/KustvaktCoreRestTest.java
rename to src/test/java/de/ids_mannheim/korap/web/service/KustvaktCoreRestTest.java
index 11a935a..88ad2bf 100644
--- a/src/test/java/KustvaktCoreRestTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/KustvaktCoreRestTest.java
@@ -1,8 +1,9 @@
+package de.ids_mannheim.korap.web.service;
+
 import com.sun.jersey.api.client.ClientResponse;
 import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.query.serialize.CollectionQueryProcessor;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.web.service.LightService;
 import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
