diff --git a/src/main/java/de/ids_mannheim/korap/config/AuditingHandler.java b/src/main/java/de/ids_mannheim/korap/config/AuditingHandler.java
index 4daf76c..30d08f1 100644
--- a/src/main/java/de/ids_mannheim/korap/config/AuditingHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/AuditingHandler.java
@@ -1,8 +1,15 @@
 package de.ids_mannheim.korap.config;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
 /**
  * @author hanl
  * @date 17/06/2015
  */
-public class AuditingHandler {
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface AuditingHandler {
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/AuthenticationHandler.java b/src/main/java/de/ids_mannheim/korap/config/AuthenticationHandler.java
index 74a3a11..d712490 100644
--- a/src/main/java/de/ids_mannheim/korap/config/AuthenticationHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/AuthenticationHandler.java
@@ -4,5 +4,5 @@
  * @author hanl
  * @date 17/06/2015
  */
-public class AuthenticationHandler {
+public @interface AuthenticationHandler {
 }
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 f4b72b1..7f53159 100644
--- a/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/BeanConfiguration.java
@@ -1,13 +1,10 @@
 package de.ids_mannheim.korap.config;
 
 import de.ids_mannheim.korap.interfaces.AuditingIface;
-import de.ids_mannheim.korap.plugins.PluginManager;
 import org.springframework.context.ApplicationContext;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 import org.springframework.context.support.FileSystemXmlApplicationContext;
 
-import java.net.URL;
-
 /**
  * User: hanl
  * Date: 10/9/13
@@ -18,28 +15,17 @@
     private static final String config_file = "default-config.xml";
 
     private static ApplicationContext context = null;
-    private static PluginManager plugins;
 
-    private static void loadPlugins() {
-        plugins = new PluginManager();
-        plugins.loadPluginInterfaces();
-    }
-
-    public static void loadContext() {
-        URL url = BeanConfiguration.class.getClassLoader()
-                .getResource(config_file);
-        if (url != null && context == null)
+    public static void loadClasspathContext(String... files) {
+        if (context == null && files == null)
             context = new ClassPathXmlApplicationContext(config_file);
+        else if (context == null)
+            context = new ClassPathXmlApplicationContext(files);
     }
 
-    public static void loadContext(String filepath) {
-        if (filepath == null)
-            loadContext();
-        else {
-            if (context == null)
-                context = new FileSystemXmlApplicationContext(
-                        "file:" + filepath);
-        }
+    public static void loadFileContext(String filepath) {
+        if (context == null)
+            context = new FileSystemXmlApplicationContext("file:" + filepath);
     }
 
     public static <T extends KustvaktConfiguration> T getConfiguration() {
diff --git a/src/main/java/de/ids_mannheim/korap/config/EncryptionHandler.java b/src/main/java/de/ids_mannheim/korap/config/EncryptionHandler.java
index cab7f6d..b0a28ac 100644
--- a/src/main/java/de/ids_mannheim/korap/config/EncryptionHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/EncryptionHandler.java
@@ -4,5 +4,5 @@
  * @author hanl
  * @date 18/06/2015
  */
-public class EncryptionHandler {
+public @interface EncryptionHandler {
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
index de4748e..4cc7f12 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
@@ -2,6 +2,7 @@
 
 import org.reflections.Reflections;
 
+import java.lang.annotation.Annotation;
 import java.util.Set;
 
 /**
@@ -23,4 +24,9 @@
     public static <T> Set<Class<? extends T>> load(Class<T> iface) {
         return reflections.getSubTypesOf(iface);
     }
+
+    public static Set<Class<?>> loadFromAnnotation(
+            Class<? extends Annotation> annotation) {
+        return reflections.getTypesAnnotatedWith(annotation);
+    }
 }
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 52ac3c7..3b089d4 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -7,6 +7,7 @@
 
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
@@ -14,6 +15,7 @@
 
 /**
  * if configuration class is extended, load method should be overriden
+ *
  * @author hanl
  * @date 05/02/2014
  */
@@ -23,21 +25,29 @@
 
     private final Logger jlog = KorAPLogger
             .initiate(KustvaktConfiguration.class);
+    private String indexDir;
+    private int port;
+    // todo: make exclusive so that the containg languages can really only be used then
+    private List<String> queryLanguages;
 
-    // deprec?!
-    private final BACKENDS DEFAULT_ENGINE = BACKENDS.LUCENE;
     private int maxhits;
 
-    private int port;
     private int returnhits;
     private String serverHost;
-    private String indexDir;
 
-    private List<String> queryLanguages;
     private String host;
 
     private URL issuer;
 
+    private String default_pos;
+    private String default_lemma;
+    private String default_surface;
+    private String default_dep;
+    private String default_const;
+
+    // deprec?!
+    private final BACKENDS DEFAULT_ENGINE = BACKENDS.LUCENE;
+
     /**
      * loading of the properties and mapping to parameter variables
      *
@@ -61,13 +71,42 @@
         for (String querylang : qls)
             queryLanguages.add(querylang.trim().toUpperCase());
         //        issuer = new URL(korap.getProperty("korap.issuer", ""));
+
+        default_const = korap.getProperty("kustvakt.default.const", "mate");
+        default_dep = korap.getProperty("kustvakt.default.dep", "mate");
+        default_lemma = korap.getProperty("kustvakt.default.lemma", "tt");
+        default_pos = korap.getProperty("kustvakt.default.pos", "tt");
+        default_surface = korap
+                .getProperty("kustvakt.default.opennlp", "opennlp");
+
         return korap;
     }
 
+    /**
+     * set properties
+     *
+     * @param props
+     */
     public void setProperties(Properties props) {
         this.load(props);
     }
 
+    /**
+     * properties can be overloaded after spring init
+     *
+     * @param stream
+     */
+    public void setProperties(InputStream stream) {
+        try {
+            Properties p = new Properties();
+            p.load(stream);
+            this.load(p);
+        }catch (IOException e) {
+            e.printStackTrace();
+        }
+
+    }
+
     public BACKENDS chooseBackend(String value) {
         if (value == null || value.equals("null"))
             return DEFAULT_ENGINE;
diff --git a/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java b/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java
index b0c473b..2944aa1 100644
--- a/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/PluginHandler.java
@@ -1,8 +1,78 @@
 package de.ids_mannheim.korap.config;
 
+import de.ids_mannheim.korap.interfaces.AuditingIface;
+import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
+
+import java.lang.annotation.Annotation;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
 /**
  * @author hanl
  * @date 17/06/2015
  */
 public class PluginHandler {
+
+    private static Map<Class<? extends Annotation>, Class> interfaces;
+    private Map<Class<? extends Annotation>, Object> plugins;
+
+    // add resource handler annotation
+    static {
+        interfaces = new HashMap<>();
+        interfaces.put(AuditingHandler.class, AuditingIface.class);
+        interfaces.put(UserDbHandler.class, EntityHandlerIface.class);
+        interfaces.put(AuthenticationHandler.class,
+                AuthenticationManagerIface.class);
+        interfaces.put(EncryptionHandler.class, EncryptionIface.class);
+        //todo:
+        interfaces.put(ResourceHandler.class, ResourceHandler.class);
+    }
+
+    public PluginHandler() {
+        this.plugins = new HashMap<>();
+        this.load();
+    }
+
+    public void load() {
+        for (Map.Entry<Class<? extends Annotation>, Class> en : new HashSet<>(
+                interfaces.entrySet())) {
+            Set<Class<?>> set = KustvaktClassLoader
+                    .loadFromAnnotation(en.getKey());
+            if (set.size() > 1)
+                throw new UnsupportedOperationException(
+                        "handler declaration not unique!");
+            else if (set.size() == 0)
+                interfaces.remove(en.getKey());
+        }
+    }
+
+    public void addInterface(Class<? extends Annotation> anno, Class<?> iface) {
+        interfaces.put(anno, iface);
+    }
+
+    public void registerPlugin(Object ob) {
+        for (Map.Entry<Class<? extends Annotation>, Class> en : interfaces
+                .entrySet()) {
+            if (en.getValue().isInstance(ob))
+                this.plugins.put(en.getKey(), ob);
+        }
+    }
+
+    public Object getPluginInstance(Class<? extends Annotation> anno) {
+        Object o = this.plugins.get(anno);
+        if (o == null)
+            return new NullPointerException(
+                    "no plugin defined for type " + anno.toString());
+        return o;
+    }
+
+    @Override
+    public String toString() {
+        System.out.println("PRINT INTERFACES " + interfaces.toString());
+        return plugins.toString();
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/ProtectedResource.java b/src/main/java/de/ids_mannheim/korap/config/ProtectedResource.java
index d93e4f0..2d24c8b 100644
--- a/src/main/java/de/ids_mannheim/korap/config/ProtectedResource.java
+++ b/src/main/java/de/ids_mannheim/korap/config/ProtectedResource.java
@@ -4,5 +4,5 @@
  * @author hanl
  * @date 18/06/2015
  */
-public class ProtectedResource {
+public @interface ProtectedResource {
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/ResourceHandler.java b/src/main/java/de/ids_mannheim/korap/config/ResourceHandler.java
index c354a01..aae143f 100644
--- a/src/main/java/de/ids_mannheim/korap/config/ResourceHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/ResourceHandler.java
@@ -4,5 +4,5 @@
  * @author hanl
  * @date 18/06/2015
  */
-public class ResourceHandler {
+public @interface ResourceHandler {
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/UserDbHandler.java b/src/main/java/de/ids_mannheim/korap/config/UserDbHandler.java
index 73fcc56..304f16c 100644
--- a/src/main/java/de/ids_mannheim/korap/config/UserDbHandler.java
+++ b/src/main/java/de/ids_mannheim/korap/config/UserDbHandler.java
@@ -1,8 +1,15 @@
 package de.ids_mannheim.korap.config;
 
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
 /**
  * @author hanl
  * @date 17/06/2015
  */
-public class UserDbHandler {
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.TYPE)
+public @interface UserDbHandler {
 }
diff --git a/src/main/java/de/ids_mannheim/korap/exceptions/BaseException.java b/src/main/java/de/ids_mannheim/korap/exceptions/BaseException.java
index 408f591..66e1197 100644
--- a/src/main/java/de/ids_mannheim/korap/exceptions/BaseException.java
+++ b/src/main/java/de/ids_mannheim/korap/exceptions/BaseException.java
@@ -7,6 +7,10 @@
 import java.util.List;
 
 /**
+ * Serves as base exception to allow auditing the exception.
+ * By extending the exception, different types of exceptions and ways of handling the audits can be created
+ * (database, service, etc.)
+ *
  * @author hanl
  * @date 29/01/2014
  */
@@ -17,7 +21,6 @@
     private Integer statusCode;
     private String entity;
 
-
     public BaseException(int code) {
         this.statusCode = code;
     }
diff --git a/src/main/java/de/ids_mannheim/korap/exceptions/KorAPException.java b/src/main/java/de/ids_mannheim/korap/exceptions/KorAPException.java
index a050770..d3435f7 100644
--- a/src/main/java/de/ids_mannheim/korap/exceptions/KorAPException.java
+++ b/src/main/java/de/ids_mannheim/korap/exceptions/KorAPException.java
@@ -7,6 +7,8 @@
  * @author hanl
  * @date 11/12/2013
  */
+//fixme: redundant with baseexception
+@Deprecated
 @Setter
 @Getter
 public class KorAPException extends BaseException {
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 82bdd55..873f435 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuditingIface.java
@@ -17,7 +17,7 @@
 public abstract class AuditingIface implements Runnable {
 
     protected static int BATCH_SIZE = 15;
-    protected final List<AuditRecord> records = new ArrayList<>(BATCH_SIZE + 5);
+    private final List<AuditRecord> records = new ArrayList<>(BATCH_SIZE + 5);
     private final List<AuditRecord> buffer = new ArrayList<>(BATCH_SIZE + 5);
 
     public abstract <T extends AuditRecord> List<T> retrieveRecords(
@@ -53,4 +53,8 @@
             addAndRun(rec);
     }
 
+    protected List<AuditRecord> getRecordsToSave() {
+        return this.records;
+    }
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java
index e02933e..600981f 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java
@@ -1,25 +1,22 @@
 package de.ids_mannheim.korap.interfaces;
 
 import de.ids_mannheim.korap.exceptions.KorAPException;
-import de.ids_mannheim.korap.ext.security.AccessLevel;
 import de.ids_mannheim.korap.user.TokenContext;
 import de.ids_mannheim.korap.user.User;
 
 import java.util.Map;
 
-public abstract class AuthenticationIface {
+public interface AuthenticationIface {
 
-    public abstract TokenContext getUserStatus(String authToken)
+    public TokenContext getUserStatus(String authToken) throws KorAPException;
+
+    public TokenContext createUserSession(User user, Map<String, Object> attr)
             throws KorAPException;
 
-    public abstract TokenContext createUserSession(User user,
-            Map<String, Object> attr) throws KorAPException;
+    public void removeUserSession(String token) throws KorAPException;
 
-    public abstract void removeUserSession(String token) throws KorAPException;
+    public TokenContext refresh(TokenContext context) throws KorAPException;
 
-    public abstract AccessLevel[] retrieveLevelAccess(String authToken)
-            throws KorAPException;
-
-    public abstract String getIdentifier();
+    public String getIdentifier();
 
 }
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 a3fb44a..4021836 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
@@ -1,9 +1,11 @@
 package de.ids_mannheim.korap.interfaces;
 
+import de.ids_mannheim.korap.config.KustvaktClassLoader;
 import de.ids_mannheim.korap.exceptions.KorAPException;
 import de.ids_mannheim.korap.user.*;
 
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
@@ -15,10 +17,23 @@
 
     private Map<String, AuthenticationIface> providers;
 
-    //todo: test if constr actually called
     public AuthenticationManagerIface() {
-        System.out.println("TEST CONSTRUCTOR CALL");
         this.providers = new HashMap<>();
+        loadProviders();
+    }
+
+    private void loadProviders() {
+        Set<Class<? extends AuthenticationIface>> set = KustvaktClassLoader
+                .load(AuthenticationIface.class);
+        Set<AuthenticationIface> set2 = new HashSet<>();
+        for (Class<? extends AuthenticationIface> i : set) {
+            try {
+                set2.add(i.newInstance());
+            }catch (InstantiationException | IllegalAccessException e) {
+                e.printStackTrace();
+            }
+        }
+        this.setProviders(set2);
     }
 
     public void setProviders(Set<AuthenticationIface> providers) {
@@ -35,14 +50,26 @@
         return iface;
     }
 
+    public abstract TokenContext getTokenStatus(String token, String host,
+            String useragent) throws KorAPException;
+
+    public abstract User getUser(String username) throws KorAPException;
+
     public abstract User authenticate(int type, String username,
             String password, Map<String, Object> attributes)
             throws KorAPException;
 
+    public abstract TokenContext createTokenContext(User user,
+            Map<String, Object> attr, String provider_key)
+            throws KorAPException;
+
     public abstract void logout(TokenContext context) throws KorAPException;
 
     public abstract void lockAccount(User user) throws KorAPException;
 
+    public abstract User createUserAccount(Map<String, Object> attributes)
+            throws KorAPException;
+
     public abstract boolean updateAccount(User user) throws KorAPException;
 
     public abstract boolean deleteAccount(User user) throws KorAPException;
@@ -57,4 +84,10 @@
 
     public abstract void updateUserSettings(User user, UserSettings settings)
             throws KorAPException;
+
+    public abstract Object[] validateResetPasswordRequest(String username,
+            String email) throws KorAPException;
+
+    public abstract void confirmRegistration(String uriFragment,
+            String username) throws KorAPException;
 }
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 cb0eef7..27bb3a1 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
@@ -6,6 +6,10 @@
 import org.joda.time.DateTime;
 import org.joda.time.LocalDate;
 
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
 import java.util.List;
 
 /**
@@ -14,37 +18,51 @@
  */
 public class DefaultAuditing extends AuditingIface {
 
-    public DefaultAuditing() {
+    private FileOutputStream stream;
 
+    public DefaultAuditing() {
+        try {
+            File f = new File("logs");
+            f.mkdirs();
+            stream = new FileOutputStream(new File(f, "audit.log"));
+        }catch (FileNotFoundException e) {
+            e.printStackTrace();
+        }
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(
             AuditRecord.CATEGORY category, DateTime day, DateTime until,
             boolean exact, int limit) {
-        return null;
+        throw new UnsupportedOperationException("operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(
             AuditRecord.CATEGORY category, User user, int limit) {
-        return null;
+        throw new UnsupportedOperationException("operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(LocalDate day,
             int hitMax) {
-        return null;
+        throw new UnsupportedOperationException("operation not supported!");
     }
 
     @Override
     public <T extends AuditRecord> List<T> retrieveRecords(String userID,
             LocalDate start, LocalDate end, int hitMax) {
-        return null;
+        throw new UnsupportedOperationException("operation not supported!");
     }
 
     @Override
     public void run() {
-        //todo: append to logging file or other auditing file
+        try {
+            for (AuditRecord r : getRecordsToSave())
+                stream.write((r.toString() + "\n").getBytes());
+            stream.flush();
+        }catch (IOException e) {
+            e.printStackTrace();
+        }
     }
 }
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 8c787db..64f3b5e 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
@@ -14,6 +14,7 @@
  * @author hanl
  * @date 05/06/2015
  */
+//todo: init!
 public class DefaultEncryption implements EncryptionIface {
 
     private SecureRandom randomizer;
diff --git a/src/main/java/de/ids_mannheim/korap/resource/LayerMapper.java b/src/main/java/de/ids_mannheim/korap/resource/LayerMapper.java
index 4b31330..f5f339d 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/LayerMapper.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/LayerMapper.java
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.resource;
 
+import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.user.UserSettings;
 
 /**
@@ -9,11 +11,15 @@
 public class LayerMapper {
 
     private UserSettings settings;
-    private ExtConfiguration config;
+    private KustvaktConfiguration config;
 
     public LayerMapper(UserSettings settings) {
         this.settings = settings;
-        this.config = ExtensionBeans.getConfiguration();
+        this.config = BeanConfiguration.getConfiguration();
+    }
+
+    public LayerMapper() {
+        this.config = BeanConfiguration.getConfiguration();
     }
 
     /**
diff --git a/src/main/java/de/ids_mannheim/korap/resource/LayerProcessor.java b/src/main/java/de/ids_mannheim/korap/resource/LayerProcessor.java
index 78fd005..71d30b1 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/LayerProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/LayerProcessor.java
@@ -1,8 +1,44 @@
 package de.ids_mannheim.korap.resource;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.util.Iterator;
+
 /**
  * @author hanl
  * @date 19/06/2015
  */
-public class LayerProcessor {
+public class LayerProcessor extends NodeProcessor {
+
+    private LayerMapper mapper;
+
+    public LayerProcessor() {
+        this.mapper = new LayerMapper();
+    }
+
+    @Override
+    public JsonNode process(JsonNode node) {
+        if (node.at("/query/wrap/@type").asText().equals("koral:term")) {
+            JsonNode n = node.at("/query/wrap");
+            if (n.path("foundry").isMissingNode()) {
+                String layer = n.path("layer").asText();
+                ObjectNode obj = (ObjectNode) n;
+                obj.put("foundry", mapper.findFoundry(layer));
+            }
+        }else if (node.at("/query/wrap/@type").asText()
+                .equals("koral:termGroup")) {
+            Iterator<JsonNode> nodes = node.at("/query/wrap/operands")
+                    .elements();
+            while (nodes.hasNext()) {
+                JsonNode n = nodes.next();
+                if (n.path("foundry").isMissingNode()) {
+                    String layer = n.path("layer").asText();
+                    ObjectNode obj = (ObjectNode) n;
+                    obj.put("foundry", mapper.findFoundry(layer));
+                }
+            }
+        }
+        return node;
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/NodeProcessor.java b/src/main/java/de/ids_mannheim/korap/resource/NodeProcessor.java
index 4f27347..c7a9451 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/NodeProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/NodeProcessor.java
@@ -1,8 +1,13 @@
 package de.ids_mannheim.korap.resource;
 
+import com.fasterxml.jackson.databind.JsonNode;
+
 /**
  * @author hanl
  * @date 19/06/2015
  */
-public class NodeProcessor {
+public abstract class NodeProcessor {
+
+    public abstract JsonNode process(JsonNode node);
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resource/RewriteProcessor.java b/src/main/java/de/ids_mannheim/korap/resource/RewriteProcessor.java
index 9950266..6031261 100644
--- a/src/main/java/de/ids_mannheim/korap/resource/RewriteProcessor.java
+++ b/src/main/java/de/ids_mannheim/korap/resource/RewriteProcessor.java
@@ -1,8 +1,41 @@
 package de.ids_mannheim.korap.resource;
 
+import com.fasterxml.jackson.databind.JsonNode;
+import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.KustvaktConfiguration;
+import de.ids_mannheim.korap.utils.JsonUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
 /**
  * @author hanl
  * @date 19/06/2015
  */
 public class RewriteProcessor {
+
+    private KustvaktConfiguration config;
+    private List<NodeProcessor> processors;
+
+    public RewriteProcessor() {
+        this.config = BeanConfiguration.getConfiguration();
+        this.processors = new ArrayList<>();
+        addProcessor(new LayerProcessor());
+    }
+
+    public JsonNode process(JsonNode node) {
+        for (NodeProcessor p : this.processors)
+            node = p.process(node);
+        return node;
+    }
+
+    public String process(String json) {
+        JsonNode node = JsonUtils.readTree(json);
+        return JsonUtils.toJSON(process(node));
+    }
+
+    public void addProcessor(NodeProcessor processor) {
+        this.processors.add(processor);
+    }
+
 }
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 1217085..1b52306 100644
--- a/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java
+++ b/src/main/java/de/ids_mannheim/korap/utils/CollectionQueryBuilder3.java
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.utils;
 
+import de.ids_mannheim.korap.query.serialize.CollectionQueryProcessor;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.LinkedList;
@@ -64,10 +66,9 @@
         List list = new ArrayList();
         if (!this.rq.isEmpty())
             list.addAll(this.rq);
-        System.out.println("RAW QUERY " + this.builder.toString());
-//        CollectionQueryProcessor tree = new CollectionQueryProcessor(this.verbose);
-//        tree.process(this.builder.toString());
-//        list.add(tree.getRequestMap());
+        CollectionQueryProcessor tree = new CollectionQueryProcessor(this.verbose);
+        tree.process(this.builder.toString());
+        list.add(tree.getRequestMap());
         return list;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java b/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java
index f9349e6..a8e4c94 100644
--- a/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java
+++ b/src/main/java/de/ids_mannheim/korap/web/Kustvakt.java
@@ -6,6 +6,8 @@
 import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.utils.KorAPLogger;
 
+import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 
 /**
@@ -15,10 +17,17 @@
 public class Kustvakt {
 
     private static Integer PORT = -1;
+    private static String CONFIG = null;
 
     public static void main(String[] args) throws Exception {
         attributes(args);
-        BeanConfiguration.loadContext();
+        BeanConfiguration.loadClasspathContext();
+
+        if (CONFIG != null) {
+            BeanConfiguration.getConfiguration()
+                    .setProperties(new FileInputStream(new File(CONFIG)));
+
+        }
         grizzlyServer(PORT);
     }
 
@@ -44,6 +53,9 @@
                 case "--debug":
                     KorAPLogger.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/service/LightService.java b/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
index bd1be22..35e1c6b 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/LightService.java
@@ -1,18 +1,14 @@
 package de.ids_mannheim.korap.web.service;
 
-import com.fasterxml.jackson.core.JsonProcessingException;
 import com.sun.jersey.core.util.MultivaluedMapImpl;
 import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KorAPException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.graphdb.collo.ColloQuery;
-import de.ids_mannheim.korap.graphdb.collo.Dependency;
-import de.ids_mannheim.korap.query.serialize.IdWriter;
 import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
+import de.ids_mannheim.korap.resource.RewriteProcessor;
 import de.ids_mannheim.korap.utils.CollectionQueryBuilder;
-import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KorAPLogger;
 import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.web.ClientsHandler;
@@ -25,13 +21,13 @@
 import javax.ws.rs.core.*;
 import java.util.ArrayList;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
 
 /**
  * @author hanl
  * @date 29/01/2014
  */
+//todd test functions
 @Path("v0.1" + "/")
 @Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
 public class LightService {
@@ -40,68 +36,19 @@
 
     private SearchLucene searchLucene;
     private ClientsHandler graphDBhandler;
+    private RewriteProcessor processor;
 
     public LightService() {
         this.searchLucene = new SearchLucene(
                 BeanConfiguration.getConfiguration().getIndexDir());
         UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
         this.graphDBhandler = new ClientsHandler(builder.build());
-    }
-
-    /**
-     * @param properties
-     * @param sfs
-     * @param limit
-     * @param query
-     * @param ql
-     * @param context
-     * @param foundry
-     * @param wPaths
-     * @return
-     */
-    //todo: add entry point where a json collection can be injected as well
-    @GET
-    @Path("colloc")
-    public Response getCollocationsAll(@QueryParam("props") String properties,
-            @QueryParam("sfskip") Integer sfs,
-            @QueryParam("sflimit") Integer limit, @QueryParam("q") String query,
-            @QueryParam("ql") String ql, @QueryParam("context") Integer context,
-            @QueryParam("foundry") String foundry,
-            @QueryParam("paths") Boolean wPaths) {
-        ColloQuery.ColloQueryBuilder builder;
-        String result;
-        try {
-            builder = new ColloQuery.ColloQueryBuilder();
-            QuerySerializer s = new QuerySerializer().setQuery(query, ql);
-            //todo: fix collectionbuilder
-            //        s.setDeprCollection(builder);
-            IdWriter writer = new IdWriter(s.toJSON()).process();
-            List collprops = JsonUtils.convertToList(properties);
-
-            if (context != null)
-                builder.context(context).collocateProps(collprops);
-            if (limit != null)
-                builder.surfaceLimit(limit);
-            if (sfs != null)
-                builder.surfaceSkip(sfs);
-            if (foundry != null)
-                builder.foundry(foundry);
-            builder.nodeQueryJS(writer.toJSON())
-                    .dep(new ArrayList<Dependency>()).withPaths(wPaths);
-
-            result = graphDBhandler
-                    .getResponse("distCollo", "q", builder.build().toJSON());
-        }catch (KorAPException e) {
-            throw KustvaktResponseHandler.throwit(e);
-        }catch (JsonProcessingException e) {
-            throw KustvaktResponseHandler.throwit(StatusCodes.ILLEGAL_ARGUMENT);
-        }
-        return Response.ok(result).build();
+        this.processor = new RewriteProcessor();
     }
 
     @POST
     @Path("colloc")
-    public Response getCollocatioBase(@QueryParam("q") String query) {
+    public Response getCollocationBase(@QueryParam("q") String query) {
         String result;
         try {
             result = graphDBhandler.getResponse("distCollo", "q", query);
@@ -111,6 +58,7 @@
         return Response.ok(result).build();
     }
 
+    // todo
     public Response postMatchFavorite() {
         return Response.ok().build();
     }
@@ -140,7 +88,7 @@
         ss.addMeta(meta);
         //todo: test this
         ss.setCollection(cq);
-        return Response.ok(ss.toJSON()).build();
+        return Response.ok(processor.process(ss.toJSON())).build();
     }
 
     @POST
@@ -149,11 +97,10 @@
             String jsonld) {
         KustvaktConfiguration.BACKENDS eng = BeanConfiguration
                 .getConfiguration().chooseBackend(engine);
-
+        jsonld = processor.process(jsonld);
         // todo: should be possible to add the meta part to the query serialization
         jlog.info("Serialized search: {}", jsonld);
 
-        // todo: Security Parsing and rewrite
         // fixme: to use the systemarchitecture pointcut thingis, searchlucene must be injected via
         String result = searchLucene.search(jsonld);
         KorAPLogger.QUERY_LOGGER.trace("The result set: {}", result);
@@ -181,8 +128,7 @@
         //        meta.addEntry("itemsPerResource", 1);
         serializer.addMeta(meta);
 
-        // policy rewrite!
-        String query = serializer.toJSON();
+        String query = processor.process(serializer.toJSON());
         jlog.info("the serialized query {}", query);
 
         if (eng.equals(KustvaktConfiguration.BACKENDS.NEO4J)) {
@@ -248,7 +194,7 @@
             // should only apply to CQL queries
             //                meta.addEntry("itemsPerResource", 1);
             s.addMeta(meta);
-            query = s.toJSON();
+            query = processor.process(s.toJSON());
         }
         String result;
         try {
@@ -326,7 +272,6 @@
                 results = searchLucene
                         .getMatch(matchid, new ArrayList<>(f_list),
                                 new ArrayList<>(l_list), spans, false, true);
-
             }
         }
         try {
diff --git a/src/main/java/de/ids_mannheim/korap/web/utils/FormWrapper.java b/src/main/java/de/ids_mannheim/korap/web/utils/FormWrapper.java
index b1dad85..913c848 100644
--- a/src/main/java/de/ids_mannheim/korap/web/utils/FormWrapper.java
+++ b/src/main/java/de/ids_mannheim/korap/web/utils/FormWrapper.java
@@ -6,10 +6,11 @@
 import java.util.Map;
 
 /**
- * @author hanl
- * @date 18/05/2015
  * Helper class to wrapp multivaluedmap into a hashmap. Depending on the strict parameter,
  * list values are retained in the resulting wrapper map.
+ *
+ * @author hanl
+ * @date 18/05/2015
  */
 public class FormWrapper extends HashMap<String, Object> {
 
diff --git a/src/main/resources/default-config.xml b/src/main/resources/default-config.xml
index 7e3c557..f0c380f 100644
--- a/src/main/resources/default-config.xml
+++ b/src/main/resources/default-config.xml
@@ -8,8 +8,6 @@
                             http://www.springframework.org/schema/util/spring-util-4.0.xsd">
 
 
-    <!--<context:property-placeholder location="classpath:kustvakt.conf"/>-->
-
     <util:properties id="props" location="classpath:kustvakt.conf"/>
 
     <bean id="auditingProvider"
diff --git a/src/test/java/RewriteTest.java b/src/test/java/RewriteTest.java
index 70bf72a..db33a1a 100644
--- a/src/test/java/RewriteTest.java
+++ b/src/test/java/RewriteTest.java
@@ -1,6 +1,58 @@
+import de.ids_mannheim.korap.config.BeanConfiguration;
+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.utils.CollectionQueryBuilder3;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
 /**
  * @author hanl
  * @date 18/06/2015
  */
 public class RewriteTest {
+
+    private static String simple_add_query = "[pos=ADJA]";
+    private static String simple_rewrite_query = "[base=Haus]";
+    private static String complex_rewrite_query = "<c=INFC>";
+    private static String complex_rewrite_query2 = "[orth=laufe/i & base!=Lauf]";
+
+    public RewriteTest() {
+
+    }
+
+    @BeforeClass
+    public static void init() {
+        BeanConfiguration.loadFileContext(
+                "/Users/hanl/Projects/KorAP-project/KorAP-modules/Kustvakt-core/src/main/resources/default-config.xml");
+    }
+
+    @Test
+    public void testQuery() {
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery(simple_add_query, "poliqarp");
+        System.out.println("query " + s.toJSON());
+
+        CollectionQueryBuilder3 b = new CollectionQueryBuilder3();
+        b.add("textClass=politik & corpusID=WPD");
+        System.out.println("collection query " + b.toJSON());
+    }
+
+    @Test
+    public void testLayerMapper() {
+        LayerMapper m = new LayerMapper();
+        System.out.println("foundry " + m.findFoundry("lemma"));
+        System.out.println("foundry " + m.findFoundry("surface"));
+        System.out.println("foundry " + m.findFoundry("pos"));
+    }
+
+    @Test
+    public void testRewrite() {
+        RewriteProcessor processor = new RewriteProcessor();
+
+        QuerySerializer s = new QuerySerializer();
+        s.setQuery(complex_rewrite_query2, "poliqarp");
+        System.out.println("query " + s.toJSON());
+        System.out.println("finished node " + processor.process(s.toJSON()));
+    }
 }
