diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java
new file mode 100644
index 0000000..34dd36c
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktBaseDaoInterface.java
@@ -0,0 +1,10 @@
+package de.ids_mannheim.korap.config;
+
+/**
+ * @author hanl
+ * @date 11/02/2016
+ */
+public interface KustvaktBaseDaoInterface {
+
+    int size();
+}
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 6016025..345dc77 100644
--- a/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktClassLoader.java
@@ -1,8 +1,11 @@
 package de.ids_mannheim.korap.config;
 
+import de.ids_mannheim.korap.interfaces.db.UserDataDbIface;
 import org.reflections.Reflections;
 
 import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
 import java.util.Set;
 
 /**
@@ -32,4 +35,19 @@
             Class<? extends Annotation> annotation) {
         return reflections.getTypesAnnotatedWith(annotation);
     }
+
+    public static Class<? extends UserDataDbIface> getClass(Class type,
+            Class iface) {
+        Set<Class<?>> c = KustvaktClassLoader.loadSubTypes(iface);
+        for (Class o : c) {
+            Type ctype = o.getGenericInterfaces()[0];
+            if (ctype instanceof ParameterizedType) {
+                ParameterizedType ptype = (ParameterizedType) ctype;
+                Class tclass = (Class) ptype.getActualTypeArguments()[0];
+                if (tclass.equals(type))
+                    return o;
+            }
+        }
+        return null;
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/config/KustvaktTypeInterface.java b/src/main/java/de/ids_mannheim/korap/config/KustvaktTypeInterface.java
new file mode 100644
index 0000000..a5270bd
--- /dev/null
+++ b/src/main/java/de/ids_mannheim/korap/config/KustvaktTypeInterface.java
@@ -0,0 +1,10 @@
+package de.ids_mannheim.korap.config;
+
+/**
+ * @author hanl
+ * @date 11/02/2016
+ */
+public interface KustvaktTypeInterface<T> {
+
+    Class<T> type();
+}
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 ccc9409..6438d67 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/DocumentDao.java
@@ -35,11 +35,6 @@
     }
 
     @Override
-    public Class<Document> getType() {
-        return Document.class;
-    }
-
-    @Override
     public Document findbyId(Integer id, User user) throws KustvaktException {
         MapSqlParameterSource s = new MapSqlParameterSource();
         s.addValue("id", id);
@@ -224,7 +219,12 @@
     }
 
     @Override
-    public int size() throws KustvaktException {
+    public int size() {
         return -1;
     }
+
+    @Override
+    public Class<Document> type() {
+        return Document.class;
+    }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
index 497b23c..5de24a6 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
@@ -1,5 +1,6 @@
 package de.ids_mannheim.korap.handlers;
 
+import de.ids_mannheim.korap.config.KustvaktBaseDaoInterface;
 import de.ids_mannheim.korap.config.ParamFields;
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.exceptions.EmptyResultException;
@@ -8,7 +9,6 @@
 import de.ids_mannheim.korap.exceptions.dbException;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
 import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
-import de.ids_mannheim.korap.user.DemoUser;
 import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.user.ShibUser;
 import de.ids_mannheim.korap.user.User;
@@ -33,7 +33,7 @@
  * @author hanl
  * @date 13/01/2014
  */
-public class EntityDao implements EntityHandlerIface {
+public class EntityDao implements EntityHandlerIface, KustvaktBaseDaoInterface {
 
     private static Logger jlog = LoggerFactory.getLogger(EntityDao.class);
     private NamedParameterJdbcTemplate jdbcTemplate;
@@ -164,7 +164,6 @@
                     "VALUES (:us, :type, :ali, " +
                     ":edu, :cn, :mail, :logs, :logft);";
             np.addValue("us", s.getUsername());
-            //            np.addValue("ali", s.getAccountLink());
             np.addValue("ali", null);
             np.addValue("edu", s.getAffiliation());
             np.addValue("mail", s.getMail());
@@ -172,23 +171,16 @@
             np.addValue("cn", s.getCn());
             np.addValue("acr", System.currentTimeMillis());
 
-            //todo: disable after first intro
-        }else if (user instanceof DemoUser) {
-            query = "INSERT INTO korap_users (username, type, account_lock, account_creation "
-                    +
-                    "password, uri_fragment, " +
-                    "uri_expiration) VALUES (:us, :type, :alo, " +
-                    ":ps, :uri, :urie);";
-
-            np.addValue("us", user.getUsername());
-            np.addValue("type", user.getType());
-            //            np.addValue("ali", user.getAccountLink());
-            np.addValue("ali", null);
-            np.addValue("alo", user.isAccountLocked());
-            np.addValue("urie", new Date(0));
-            np.addValue("ps", DemoUser.PASSPHRASE);
-            np.addValue("uri", "");
-            np.addValue("acr", System.currentTimeMillis());
+            //todo: deprecate
+            //        }else if (user instanceof DemoUser) {
+            //            query = "INSERT INTO korap_users (id, username, type, account_lock, account_creation) VALUES "
+            //                    + "(:id, :us, :type, :alo);";
+            //
+            //            np.addValue("id", user.getId());
+            //            np.addValue("us", user.getUsername());
+            //            np.addValue("type", user.getType());
+            //            np.addValue("alo", user.isAccountLocked());
+            //            np.addValue("acr", System.currentTimeMillis());
         }else
             return -1;
 
@@ -202,7 +194,6 @@
         }catch (DataAccessException e) {
             jlog.error("Could not create user account with username: {}",
                     user.getUsername());
-            e.printStackTrace();
             throw new dbException(user.getUsername(), "korap_users",
                     StatusCodes.NAME_EXISTS, user.getUsername());
         }
@@ -286,7 +277,6 @@
         return this.jdbcTemplate
                 .queryForObject(query, new HashMap<String, Object>(),
                         Integer.class);
-
     }
 
     //todo:
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java b/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
index 6161cdb..18b4e87 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/JDBCClient.java
@@ -52,7 +52,7 @@
         try {
             // uses flyway schema table to determine of schema was applied succesfully
             size = tmp.queryForObject(
-                    "select count(*) from schema_version limit 10;",
+                    "select count(*) from schema_version limit 5;",
                     new HashMap<String, Object>(), Integer.class);
         }catch (Exception e) {
             System.out.println("No database schema found!");
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 0869236..2093a13 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/ResourceDao.java
@@ -38,7 +38,7 @@
     }
 
     @Override
-    public Class<T> getType() {
+    public Class<T> type() {
         return (Class<T>) KustvaktResource.class;
     }
 
@@ -150,7 +150,7 @@
         source.addValue("name", resource.getName());
         source.addValue("pid", resource.getPersistentID());
         source.addValue("parent", parid);
-        source.addValue("ow", resource.getOwner());
+        source.addValue("ow", user.getId());
         source.addValue("desc", resource.getDescription());
         source.addValue("type",
                 ResourceFactory.getResourceMapping(resource.getClass()));
@@ -194,14 +194,14 @@
     }
 
     @Override
-    public int size() throws KustvaktException {
+    public int size() {
         final String sql = "SELECT COUNT(*) FROM resource_store;";
         try {
             return this.jdbcTemplate
                     .queryForObject(sql, new HashMap<String, Object>(),
                             Integer.class);
         }catch (DataAccessException e) {
-            return -1;
+            return 0;
         }
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java b/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
index 22c600c..9ed2524 100644
--- a/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
+++ b/src/main/java/de/ids_mannheim/korap/handlers/RowMapperFactory.java
@@ -4,7 +4,6 @@
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.resources.ResourceFactory;
-import de.ids_mannheim.korap.resources.VirtualCollection;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.KorAPUser;
 import de.ids_mannheim.korap.user.ShibUser;
@@ -106,7 +105,6 @@
             KustvaktResource r = ResourceFactory.getResource(rs.getInt("type"));
             if (r != null) {
                 r.setId(rs.getInt("id"));
-                r.setOwner(rs.getInt("creator"));
                 r.setName(rs.getString("name"));
 
                 r.setFields(rs.getString("data"));
@@ -119,25 +117,4 @@
         }
 
     }
-
-    // todo: ??!
-    public static class CollectionMapper
-            implements RowMapper<VirtualCollection> {
-
-        @Override
-        public VirtualCollection mapRow(ResultSet rs, int i)
-                throws SQLException {
-            VirtualCollection c = ResourceFactory
-                    .getCollection(rs.getInt("id"), false);
-            c.setPersistentID(rs.getString("persistent_id"));
-            c.setCreated(rs.getTimestamp("created").getTime());
-            c.setName(rs.getString("name"));
-            c.setDescription(rs.getString("description"));
-            c.setOwner(rs.getInt("user_id"));
-            c.setFields(rs.getString("data"));
-            c.checkNull();
-            return c;
-        }
-    }
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
index 932c069..b596b55 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/EntityHandlerIface.java
@@ -25,6 +25,4 @@
 
     int activateAccount(String username, String uriToken)
             throws KustvaktException;
-
-    int size();
 }
diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/db/PolicyHandlerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/db/PolicyHandlerIface.java
index e563f58..5b6866d 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/db/PolicyHandlerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/db/PolicyHandlerIface.java
@@ -34,6 +34,8 @@
      */
     List<SecurityPolicy>[] getPolicies(Integer target, User user, Byte perm);
 
+    List<SecurityPolicy>[] getPolicies(PolicyCondition condition, Byte perm);
+
     /**
      * @param policy
      * @return
@@ -86,8 +88,7 @@
      * @param id
      * @param user
      */
-    //todo: test
-    void deleteResourcePolicies(String id, User user) throws KustvaktException;
+    int deleteResourcePolicies(String id, User user) throws KustvaktException;
 
     /**
      * @param policy
@@ -157,7 +158,7 @@
      * @param param
      * @throws KustvaktException
      */
-    void createParamBinding(Parameter param) throws KustvaktException;
+    int createParamBinding(Parameter param) throws KustvaktException;
 
     /**
      * @param condition
@@ -171,6 +172,8 @@
      * @param policy
      * @throws KustvaktException
      */
-    void removeParamBinding(SecurityPolicy policy) throws KustvaktException;
+    int removeParamBinding(SecurityPolicy policy) throws KustvaktException;
+
+    int size();
 
 }
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 d35f924..2682604 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
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.interfaces.db;
 
+import de.ids_mannheim.korap.config.KustvaktBaseDaoInterface;
+import de.ids_mannheim.korap.config.KustvaktTypeInterface;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.user.User;
@@ -9,11 +11,8 @@
 
 // todo: for transaction to work this should go into core module!?!
 // todo: user instance only required for auditing pointcut operations
-public interface ResourceOperationIface<T extends KustvaktResource> {
-
-    // todo: remove and use type reference!
-    @Deprecated
-    Class<T> getType();
+public interface ResourceOperationIface<T extends KustvaktResource>
+        extends KustvaktTypeInterface<T>, KustvaktBaseDaoInterface {
 
     <T extends KustvaktResource> T findbyId(String id, User user)
             throws KustvaktException;
@@ -42,7 +41,4 @@
     int deleteResource(String id, User user) throws KustvaktException;
 
     int deleteAll() throws KustvaktException;
-
-    int size() throws KustvaktException;
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Corpus.java b/src/main/java/de/ids_mannheim/korap/resources/Corpus.java
index 8dd64e6..fdd9660 100755
--- a/src/main/java/de/ids_mannheim/korap/resources/Corpus.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/Corpus.java
@@ -22,12 +22,12 @@
         super();
     }
 
-    public Corpus(Integer id, int creator) {
-        super(id, creator);
+    public Corpus(String pers) {
+        super(pers);
     }
 
-    public Corpus(String pers_id, int creator) {
-        super(pers_id, creator);
+    public Corpus(Integer id) {
+        super(id);
     }
 
     @Override
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Foundry.java b/src/main/java/de/ids_mannheim/korap/resources/Foundry.java
index 51e14f0..11753d5 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/Foundry.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/Foundry.java
@@ -10,13 +10,12 @@
         super();
     }
 
-    public Foundry(Integer id, int creator) {
-        super(id, creator);
+    public Foundry(Integer id) {
+        super(id);
     }
 
-    public Foundry(String persistentID, int creator) {
-        super(persistentID, creator);
-        this.setName(persistentID);
+    public Foundry(String persistentID) {
+        super(persistentID);
     }
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java b/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
index 259b033..7c25292 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/KustvaktResource.java
@@ -24,8 +24,10 @@
     private String name;
     private String description;
     // todo: manage creator over policies!
-    @JsonIgnore
-    private Integer owner;
+
+    //    @JsonIgnore
+    //    @Deprecated
+    //    private Integer owner;
     protected long created;
     @Deprecated
     private boolean managed;
@@ -38,26 +40,23 @@
     @Getter(AccessLevel.PROTECTED)
     private Map<String, Object> fields;
 
-    // todo: redo constructors
-    protected KustvaktResource() {
+    public KustvaktResource() {
         this.created = TimeUtils.getNow().getMillis();
         this.id = -1;
         this.parentID = null;
         this.fields = new HashMap<>();
     }
 
-    public KustvaktResource(Integer id, int creator) {
+    public KustvaktResource(Integer id) {
         this.created = TimeUtils.getNow().getMillis();
         this.id = id;
-        this.owner = creator;
         this.parentID = null;
         this.fields = new HashMap<>();
     }
 
     // todo: move creator to builder instance for policies
-    public KustvaktResource(String persistentID, int creator) {
+    public KustvaktResource(String persistentID) {
         this();
-        this.owner = creator;
         this.persistentID = persistentID;
     }
 
@@ -136,11 +135,11 @@
                 this.getCreated() :
                 other.getCreated());
         this.setPath(this.getPath() == null ? other.getPath() : this.getPath());
-        this.setOwner(
-                this.getOwner() == null ? other.getOwner() : this.getOwner());
-        this.setManaged(
-                !this.isManaged() ? other.isManaged() : this.isManaged());
-        this.setShared(!this.isShared() ? other.isShared() : this.isShared());
+        //        this.setOwner(
+        //                this.getOwner() == null ? other.getOwner() : this.getOwner());
+        //        this.setManaged(
+        //                !this.isManaged() ? other.isManaged() : this.isManaged());
+        //        this.setShared(!this.isShared() ? other.isShared() : this.isShared());
     }
 
     /**
@@ -156,11 +155,6 @@
         setName(this.getName() == null ? "" : this.getName());
     }
 
-    protected String createID() {
-        //        return utils.randomAlphanumeric(10);
-        return "";
-    }
-
     /**
      * this method is used to return field information about the class
      * All subclasses should override this method
@@ -190,7 +184,6 @@
                 ", name='" + name + '\'' +
                 ", created=" + created +
                 ", path=" + path +
-                ", owner=" + owner +
                 '}';
     }
 
@@ -198,20 +191,17 @@
     @Getter
     public static class Container {
         private final Class type;
-        //        private final Integer id;
         private final String persistentID;
         private final boolean set;
 
         public Container(String persistentID, Class type) {
             this.type = type;
-            //            this.id = id;
             this.set = true;
             this.persistentID = persistentID;
         }
 
         public Container(Class type) {
             this.type = type;
-            //            this.id = id;
             this.set = true;
             this.persistentID = null;
         }
@@ -219,7 +209,6 @@
         public Container() {
             this.set = false;
             this.type = null;
-            //            this.id = null;
             this.persistentID = null;
         }
 
diff --git a/src/main/java/de/ids_mannheim/korap/resources/Layer.java b/src/main/java/de/ids_mannheim/korap/resources/Layer.java
index 7203216..2dc411c 100644
--- a/src/main/java/de/ids_mannheim/korap/resources/Layer.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/Layer.java
@@ -10,25 +10,24 @@
         super();
     }
 
-
     public Layer(Integer id, int creator) {
-        super(id, creator);
+        super(id);
     }
 
     // layer name must not be unique!
-    public Layer(Integer id, String name, int creator) {
-        super(id, creator);
+    public Layer(Integer id, String name) {
+        super(id);
         this.setName(name);
     }
 
-    public Layer(String persistentID, String name, int creator) {
-        super(persistentID, creator);
+    public Layer(String persistentID, String name) {
+        super(persistentID);
         this.setPersistentID(persistentID);
         this.setName(name);
     }
 
-    public Layer(String persistentID, int creator) {
-        super(persistentID, creator);
+    public Layer(String persistentID) {
+        super(persistentID);
     }
 
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
index e854b49..231017b 100755
--- a/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/ResourceFactory.java
@@ -1,5 +1,7 @@
 package de.ids_mannheim.korap.resources;
 
+import org.apache.commons.codec.digest.DigestUtils;
+
 import java.util.ArrayList;
 import java.util.List;
 
@@ -54,6 +56,12 @@
         return null;
     }
 
+    public static <T extends KustvaktResource> T createID(T resource) {
+        if (resource.getData() != null && !resource.getData().isEmpty())
+            resource.setPersistentID(DigestUtils.sha1Hex(resource.getData()));
+        return resource;
+    }
+
     public static <T extends KustvaktResource> Class<T> getResourceClass(
             String type) {
         for (Class value : subTypes) {
@@ -79,53 +87,50 @@
     }
 
     public static VirtualCollection getPermanentCollection(
-            VirtualCollection mergable, String corpusName, String description,
-            Integer owner) {
+            VirtualCollection mergable, String corpusName, String description) {
         VirtualCollection v = new VirtualCollection();
         v.merge(mergable);
-        v.setPersistentID(v.createID());
         v.setName(corpusName);
         v.setDescription(description);
-        v.setOwner(owner);
-        return v;
+        return createID(v);
     }
 
-    public static VirtualCollection createCollection(String name, String query,
-            Integer owner) {
-        VirtualCollection v = new VirtualCollection(query);
-        v.setName(name);
-        v.setOwner(owner);
-        return v;
-    }
+    //    public static VirtualCollection createCollection(String name, String query,
+    //            Integer owner) {
+    //        VirtualCollection v = new VirtualCollection(query);
+    //        v.setName(name);
+    //        v.setOwner(owner);
+    //        return v;
+    //    }
+    //
+    //    public static VirtualCollection createCollection(String name,
+    //            Integer owner) {
+    //        VirtualCollection v = new VirtualCollection();
+    //        v.setOwner(owner);
+    //        v.setName(name);
+    //        return v;
+    //    }
+    //
+    //    public static VirtualCollection getCollection(Integer collectionID,
+    //            boolean cache) {
+    //        VirtualCollection v = new VirtualCollection();
+    //        v.setId(collectionID);
+    //        v.setDescription("");
+    //        v.setName("");
+    //        return v;
+    //    }
+    //
+    //    public static VirtualCollection createContainer(String name,
+    //            String description, String query, Integer owner) {
+    //        VirtualCollection v = new VirtualCollection(query);
+    //        v.setName(name);
+    //        v.setDescription(description);
+    //        v.setOwner(owner);
+    //        v.setManaged(true);
+    //        return v;
+    //    }
 
-    public static VirtualCollection createCollection(String name,
-            Integer owner) {
-        VirtualCollection v = new VirtualCollection();
-        v.setOwner(owner);
-        v.setName(name);
-        return v;
-    }
-
-    public static VirtualCollection getCollection(Integer collectionID,
-            boolean cache) {
-        VirtualCollection v = new VirtualCollection();
-        v.setId(collectionID);
-        v.setDescription("");
-        v.setName("");
-        return v;
-    }
-
-    public static VirtualCollection createContainer(String name,
-            String description, String query, Integer owner) {
-        VirtualCollection v = new VirtualCollection(query);
-        v.setName(name);
-        v.setDescription(description);
-        v.setOwner(owner);
-        v.setManaged(true);
-        return v;
-    }
-
-    public static VirtualCollection getIDContainer(Integer id, Integer owner) {
-        return new VirtualCollection(id, owner);
+    public static VirtualCollection getIDContainer(Integer id) {
+        return new VirtualCollection(id);
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java b/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
index 5ffbb13..74ff1c8 100755
--- a/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
+++ b/src/main/java/de/ids_mannheim/korap/resources/VirtualCollection.java
@@ -2,7 +2,6 @@
 
 import lombok.Getter;
 import lombok.Setter;
-import org.apache.commons.codec.digest.DigestUtils;
 
 import java.util.Map;
 
@@ -17,33 +16,16 @@
     @Deprecated
     private Map stats;
 
-    protected VirtualCollection() {
+    public VirtualCollection() {
         super();
-        this.setPersistentID(this.createID());
     }
 
-    public VirtualCollection(Integer id, int creator) {
-        super(id, creator);
+    public VirtualCollection(Integer id) {
+        super(id);
     }
 
-    public VirtualCollection(String persistentID, int creator) {
-        super(persistentID, creator);
-    }
-
-    public VirtualCollection(String query) {
-        this();
-        this.setFields(query);
-        this.setPersistentID(this.createID());
-    }
-
-    // todo: redo!
-    @Override
-    protected String createID() {
-        if (this.getData() != null) {
-            String s = this.getData();
-            return DigestUtils.sha1Hex(s);
-        }
-        return super.createID();
+    public VirtualCollection(String persistentID) {
+        super(persistentID);
     }
 
     @Override
@@ -60,9 +42,9 @@
     @Override
     @SuppressWarnings("unchecked")
     public void checkNull() {
-        super.checkNull();
         this.setDescription(
                 this.getDescription() == null ? "" : this.getDescription());
+        super.checkNull();
     }
 
     @Override
@@ -72,7 +54,6 @@
                 ", persistentID='" + this.getPersistentID() + '\'' +
                 ", created=" + created +
                 ", path=" + this.getPath() +
-                ", owner=" + this.getOwner() +
                 ", name='" + this.getName() + '\'' +
                 ", data='" + this.getData() + '\'' +
                 '}';
diff --git a/src/main/java/de/ids_mannheim/korap/security/Parameter.java b/src/main/java/de/ids_mannheim/korap/security/Parameter.java
index 7eab421..88f433e 100644
--- a/src/main/java/de/ids_mannheim/korap/security/Parameter.java
+++ b/src/main/java/de/ids_mannheim/korap/security/Parameter.java
@@ -8,6 +8,7 @@
  * @author hanl@ids-mannheim.de
  * @date 09/11/13
  */
+//todo:
 @Getter
 public class Parameter extends KustvaktResource {
 
@@ -22,7 +23,6 @@
         super.setName(identifier.toLowerCase());
         this.value = value;
         this.equal = equal;
-        super.setOwner(user.getId());
     }
 
     @Override
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java b/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
index c239f99..d06764f 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/ConditionManagement.java
@@ -47,8 +47,8 @@
                 == 1) {
             policydao.addToCondition(usernames, condition, admin);
         }else
-            jlog.error("Users could not be added to condition '{}'",
-                    condition.getSpecifier());
+            jlog.error("Users '{}' could not be added to condition '{}'",
+                    usernames, condition.getSpecifier());
     }
 
     public void addUser(String username, PolicyCondition condition,
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
index e006d87..eb30029 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyDao.java
@@ -29,6 +29,7 @@
 import java.sql.SQLException;
 import java.sql.Timestamp;
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 
 /**
@@ -128,6 +129,7 @@
                 this.jdbcTemplate.batchUpdate(remove, sources_removed);
             }
 
+            // todo: naming convention!
             if (!policy.getAdded().isEmpty()) {
                 idx = 0;
                 MapSqlParameterSource[] sources = new MapSqlParameterSource[policy
@@ -226,7 +228,7 @@
                         @Override
                         public List<SecurityPolicy>[] extractData(ResultSet rs)
                                 throws SQLException, DataAccessException {
-                            return SecurityRowMappers.mapping(rs, user);
+                            return SecurityRowMappers.mapping(rs);
                         }
                     });
         }catch (DataAccessException e) {
@@ -238,6 +240,47 @@
     }
 
     @Override
+    public List<SecurityPolicy>[] getPolicies(PolicyCondition condition,
+            Byte perm) {
+        MapSqlParameterSource param = new MapSqlParameterSource();
+        param.addValue("cond", condition.getSpecifier());
+        param.addValue("perm", perm);
+        param.addValue("en", new Timestamp(TimeUtils.getNow().getMillis()));
+
+        String sql_new = "select pv.*, pv.perm & :perm as allowed, " +
+                "rh.depth, (select max(depth) from resource_tree " +
+                "where child_id=rh.child_id) as max_depth from policy_view as pv "
+                +
+                "inner join resource_tree as rh on rh.parent_id=pv.id " +
+                "where " +
+                "pv.enable <= :en and (pv.expire > :en or pv.expire is NULL) and "
+                +
+                "(pv.group_id='self' or pv.group_id=:cond) and " +
+                "(select sum(distinct depth) from resource_tree where child_id=rh.child_id) = "
+                +
+                "(select sum(distinct res.depth) from policy_view as pos inner join resource_tree as res on res.parent_id=pos.id where (pos.group_id=:cond)"
+                +
+                " or pos.group_id='self') and res.child_id=rh.child_id group by child_id)";
+
+        try {
+            return this.jdbcTemplate.query(sql_new, param,
+                    new ResultSetExtractor<List<SecurityPolicy>[]>() {
+
+                        @Override
+                        public List<SecurityPolicy>[] extractData(ResultSet rs)
+                                throws SQLException, DataAccessException {
+                            return SecurityRowMappers.mapping(rs);
+                        }
+                    });
+        }catch (DataAccessException e) {
+            e.printStackTrace();
+            jlog.error("Permission Denied for policy retrieval for '{}'",
+                    condition.getSpecifier());
+            return new List[2];
+        }
+    }
+
+    @Override
     public List<SecurityPolicy>[] getPolicies(String target, final User user,
             Byte perm) {
         MapSqlParameterSource param = new MapSqlParameterSource();
@@ -246,7 +289,6 @@
         param.addValue("perm", perm);
         param.addValue("en", new Timestamp(TimeUtils.getNow().getMillis()));
 
-        // fixme: missing constraint of user group membership!
         String sql_new = "select pv.*, pv.perm & :perm as allowed, " +
                 "rh.depth, (select max(depth) from resource_tree " +
                 "where child_id=rh.child_id) as max_depth from policy_view as pv "
@@ -271,7 +313,7 @@
                         @Override
                         public List<SecurityPolicy>[] extractData(ResultSet rs)
                                 throws SQLException, DataAccessException {
-                            return SecurityRowMappers.mapping(rs, user);
+                            return SecurityRowMappers.mapping(rs);
                         }
                     });
         }catch (DataAccessException e) {
@@ -314,7 +356,7 @@
                         @Override
                         public List<SecurityPolicy>[] extractData(ResultSet rs)
                                 throws SQLException, DataAccessException {
-                            return SecurityRowMappers.mapping(rs, user);
+                            return SecurityRowMappers.mapping(rs);
                         }
                     });
         }catch (DataAccessException e) {
@@ -505,13 +547,13 @@
     }
 
     @Override
-    public void deleteResourcePolicies(String id, User user)
+    public int deleteResourcePolicies(String id, User user)
             throws KustvaktException {
         MapSqlParameterSource param = new MapSqlParameterSource();
         param.addValue("id", id);
-        String sql = "DELETE FROM policy_store WHERE target_id=:id;";
+        String sql = "DELETE FROM policy_store WHERE target_id in (SELECT id FROM resource_store WHERE persistent_id=:id);";
         try {
-            this.jdbcTemplate.update(sql, param);
+            return this.jdbcTemplate.update(sql, param);
         }catch (DataAccessException e) {
             jlog.error("Operation (DELETE) not possible for '{}' for user '{}'",
                     id, user.getId());
@@ -638,10 +680,16 @@
             param.addValue("status", BooleanUtils.getBoolean(admin));
             return this.jdbcTemplate.update(insert, param);
         }catch (DataAccessException e) {
-            jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
-                    condition.toString(), username);
-            throw new dbException(null, "group_store",
-                    StatusCodes.DB_INSERT_FAILED, condition.toString());
+            //todo: test with mysql
+            if (!e.getMessage().toLowerCase()
+                    .contains("UNIQUE".toLowerCase())) {
+                jlog.error(
+                        "Operation (INSERT) not possible for '{}' for user '{}'",
+                        condition.toString(), username);
+                throw new dbException(null, "group_store",
+                        StatusCodes.DB_INSERT_FAILED, condition.toString());
+            }
+            return 0;
         }
     }
 
@@ -661,7 +709,7 @@
         MapSqlParameterSource[] sources = new MapSqlParameterSource[usernames
                 .size()];
 
-        //        todo: use unique index for that! problematic though --> why?
+        //        todo: use unique index for that! problematic though --> why? no special exception?
         //        final String select = "select count(id) from group_users where userID=" +
         //                "(select id from korap_users where username=:username) " +
         //                "AND group_id=:group;";
@@ -673,6 +721,7 @@
                         "WHERE username=:username), :group, :status);";
         try {
             for (int idx = 0; idx < usernames.size(); idx++) {
+                //todo: dont do that here
                 if (usernames.get(idx) == null || usernames.get(idx).isEmpty())
                     throw new KustvaktException(StatusCodes.ILLEGAL_ARGUMENT);
 
@@ -684,7 +733,6 @@
                 // that as checkup (may also be manageable via triggers)
                 //                if (this.jdbcTemplate
                 //                        .queryForObject(select, param, Integer.class) == 0)
-                System.out.println("PARAMETER MAP " + param.getValues());
                 sources[idx] = param;
             }
 
@@ -692,12 +740,16 @@
             //fixme: problem - unique constraints throws exception. skip that user entry?!
             return this.jdbcTemplate.batchUpdate(insert, sources);
         }catch (DataAccessException e) {
-            jlog.error("Operation (INSERT) not possible for '{}' for user '{}'",
-                    condition.toString(), usernames, e);
-            throw new KustvaktException(
-                    "Operation (INSERT) not possible for '" + condition
-                            .toString() + "' for user '" + usernames + "'", e,
-                    StatusCodes.CONNECTION_ERROR);
+            if (!e.getCause().toString().contains("UNIQUE")) {
+                jlog.error(
+                        "Operation (INSERT) not possible for '{}' for user '{}'",
+                        condition.toString(), usernames, e);
+                throw new KustvaktException(
+                        "Operation (INSERT) not possible for '" + condition
+                                .toString() + "' for user '" + usernames + "'",
+                        e, StatusCodes.CONNECTION_ERROR);
+            }
+            return null;
         }
     }
 
@@ -728,20 +780,21 @@
     }
 
     @Override
-    public void createParamBinding(Parameter param) throws KustvaktException {
+    public int createParamBinding(Parameter param) throws KustvaktException {
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("key", param.getName());
         source.addValue("policy", param.getPolicy().getID());
         source.addValue("value", param.getValue());
         source.addValue("flag", param.isEqual());
 
-        if (!parameterExists(param.getName()))
-            createParameter(param.getName(), "", param.getOwner());
+        //todo:
+        //        if (!parameterExists(param.getName()))
+        //            createParameter(param.getName(), "", param.getOwner());
         final String insert =
                 "INSERT INTO param_map (param_id, policy_id, value, flag) VALUES ((SELECT id FROM param_store "
                         + "WHERE p_key=:key), (SELECT id FROM policy_store WHERE id=:policy), :value, :flag);";
         try {
-            this.jdbcTemplate.update(insert, source);
+            return this.jdbcTemplate.update(insert, source);
         }catch (DataAccessException e) {
             jlog.error("Operation (INSERT) not possible for '{}",
                     param.toString());
@@ -789,16 +842,28 @@
     }
 
     @Override
-    public void removeParamBinding(SecurityPolicy policy)
+    public int removeParamBinding(SecurityPolicy policy)
             throws KustvaktException {
         MapSqlParameterSource source = new MapSqlParameterSource();
         source.addValue("id", policy.getID());
         final String sql = "DELETE FROM param_map WHERE policy_id=:id";
         try {
-            this.jdbcTemplate.update(sql, source);
+            return this.jdbcTemplate.update(sql, source);
         }catch (DataAccessException e) {
             throw new KustvaktException(e, StatusCodes.CONNECTION_ERROR);
         }
     }
 
+    @Override
+    public int size() {
+        String sql = "SELECT COUNT(*) FROM policy_view;";
+        try {
+            return this.jdbcTemplate
+                    .queryForObject(sql, new HashMap<String, Object>(),
+                            Integer.class);
+        }catch (DataAccessException e) {
+            return 0;
+        }
+    }
+
 }
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyEvaluator.java b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyEvaluator.java
index 4e6508a..d76848a 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/PolicyEvaluator.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/PolicyEvaluator.java
@@ -147,8 +147,8 @@
     public static PolicyEvaluator setFlags(User user,
             KustvaktResource resource) {
         PolicyEvaluator e = new PolicyEvaluator(user, resource);
-        e.setFlag("managed", resource.getOwner() == KorAPUser.ADMINISTRATOR_ID);
-        e.setFlag("shared", false);
+//        e.setFlag("managed", resource.getOwner() == KorAPUser.ADMINISTRATOR_ID);
+//        e.setFlag("shared", false);
         return e;
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
index 5cd0738..822c94c 100755
--- a/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/ResourceFinder.java
@@ -8,6 +8,8 @@
 import de.ids_mannheim.korap.resources.Permissions;
 import de.ids_mannheim.korap.resources.ResourceFactory;
 import de.ids_mannheim.korap.security.PermissionsBuffer;
+import de.ids_mannheim.korap.security.PolicyCondition;
+import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.User;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -32,6 +34,11 @@
         checkProviders();
     }
 
+    private ResourceFinder() {
+        this.containers = new ArrayList<>();
+        checkProviders();
+    }
+
     private static void checkProviders() {
         if (BeanConfiguration.hasContext() && policydao == null) {
             ResourceFinder.policydao = BeanConfiguration.getBeans()
@@ -73,6 +80,18 @@
                 Permissions.PERMISSIONS.READ);
     }
 
+    public static <T extends KustvaktResource> Set<T> searchPublic(
+            Class<T> clazz) {
+        List[] list = policydao
+                .getPolicies(new PolicyCondition(Attributes.PUBLIC_GROUP),
+                        Permissions.READ);
+        System.out.println("_____________________");
+        System.out.println("list 1 " + list[0]);
+        System.out.println("list 1 " + list[1]);
+        return new HashSet<>();
+
+    }
+
     // todo: should this be working?
     public static <T extends KustvaktResource> Set<T> search(User user,
             Class<T> clazz) throws KustvaktException {
@@ -107,7 +126,7 @@
                     if (resource != null) {
                         PolicyEvaluator e = PolicyEvaluator
                                 .setFlags(user, resource);
-                        resource.setManaged(e.getFlag("managed", false));
+                        //                        resource.setManaged(e.getFlag("managed", false));
                         resources.add(resource);
                     }
                 }catch (KustvaktException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
index d37385d..94d08e6 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityManager.java
@@ -66,7 +66,7 @@
             SecurityManager.handlers = new HashMap<>();
             ResourceOperationIface rprovider = BeanConfiguration.getBeans()
                     .getResourceProvider();
-            SecurityManager.handlers.put(rprovider.getType(), rprovider);
+            SecurityManager.handlers.put(rprovider.type(), rprovider);
         }
         if (policydao == null && crypto == null)
             throw new RuntimeException("providers not set!");
@@ -79,8 +79,8 @@
         SecurityManager.crypto = crypto;
         SecurityManager.handlers = new HashMap<>();
         jlog.info("Registering handlers: {}", Arrays.asList(ifaces));
-        for (ResourceOperationIface iface : ifaces)
-            handlers.put(iface.getType(), iface);
+        //        for (ResourceOperationIface iface : ifaces)
+        //            handlers.put(iface.getType(), iface);
     }
 
     /**
@@ -213,9 +213,9 @@
         if (id instanceof Integer)
             this.policies = policydao
                     .getPolicies((Integer) id, this.user, b.getPbyte());
-        //        System.out.println("-------------------------------");
-        //        System.out.println("LENGTH OF POLICY ARRAY " + this.policies.length);
-        //        System.out.println("POLICY AT 0 " + this.policies[0]);
+//        System.out.println("-------------------------------");
+//        System.out.println("LENGTH OF POLICY ARRAY " + this.policies.length);
+//        System.out.println("POLICY AT 0 " + this.policies[0]);
         this.evaluator = new PolicyEvaluator(this.user, this.policies);
 
         if (this.policies == null) {
@@ -275,12 +275,13 @@
             // create persistent identifier for the resource
             if (resource.getPersistentID() == null || resource.getPersistentID()
                     .isEmpty()) {
+                // todo: use resource data!
                 resource.setPersistentID(p.crypto.createID());
                 newid = true;
             }
 
             if (newid | !p.checkResource(resource.getPersistentID(), user)) {
-                resource.setOwner(user.getId());
+                //                resource.setOwner(user.getId());
 
                 jlog.info("Creating Access Control structure for resource '"
                         + resource.getPersistentID() + "@" + resource.getId()
diff --git a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
index 4dedb30..48f339a 100644
--- a/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
+++ b/src/main/java/de/ids_mannheim/korap/security/ac/SecurityRowMappers.java
@@ -5,7 +5,6 @@
 import de.ids_mannheim.korap.security.PolicyCondition;
 import de.ids_mannheim.korap.security.PolicyContext;
 import de.ids_mannheim.korap.security.SecurityPolicy;
-import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.PrefixTreeMap;
 import lombok.Data;
 import org.springframework.dao.DataAccessException;
@@ -71,7 +70,7 @@
         }
     }
 
-    public static List<SecurityPolicy>[] mapping(ResultSet rs, User user)
+    public static List<SecurityPolicy>[] mapping(ResultSet rs)
             throws SQLException {
         List<SecurityPolicy>[] policyArray = null;
         List<Integer>[] idx = null;
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 b3fbbed..29c3641 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
@@ -86,6 +86,9 @@
         String key = cache_key(username);
         Element e = user_cache.get(key);
 
+        if (User.UserFactory.isDemo(username))
+            return User.UserFactory.getDemoUser();
+
         if (e != null) {
             Map map = (Map) e.getObjectValue();
             user = User.UserFactory.toUser(map);
@@ -491,6 +494,8 @@
         }
         user.setPassword(hash);
         try {
+            jlog.info("Creating new user account for user {}",
+                    user.getUsername());
             entHandler.createAccount(user);
             UserDetails details = new UserDetails(user.getId());
             details.readDefaults(safeMap);
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 96a80fb..3fe16bd 100644
--- a/src/main/java/de/ids_mannheim/korap/user/Attributes.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Attributes.java
@@ -13,6 +13,8 @@
     public static final String CLIENT_SECRET = "client_secret";
     public static final String SCOPES = "scopes";
 
+    public static final String PUBLIC_GROUP = "public";
+
     public static final String SERVICE_ACCESS = "service_access";
     public static final String USER = "KorapUser";
     public static final String SHIBUSER = "ShibUser";
@@ -155,7 +157,7 @@
     public static final String DISABLED = "disabled";
     public static final String USER_ID = "user_id";
     public static final String PARENT_ID = "parent_id";
-//    public static final String
+    //    public static final String
 
 }
 
diff --git a/src/main/java/de/ids_mannheim/korap/user/DemoUser.java b/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
index b1ceef1..cdb6671 100644
--- a/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
+++ b/src/main/java/de/ids_mannheim/korap/user/DemoUser.java
@@ -12,11 +12,11 @@
     public static final String DEMOUSER_NAME = "demo";
     public static final Integer DEMOUSER_ID = 1654234534;
     private static final long ACCOUNT_CREATED = 1377102171202L;
-    public static final String PASSPHRASE = "$2a$15$rGPvLWm5JJ1iYj0V61e5guYIGmSo.rjdBkAVIU1vWS/xdybmABxRa";
+    public static final String PASSPHRASE = "demo";
 
-    // todo: test functionality!
     protected DemoUser() {
         super(DEMOUSER_NAME, 2);
+        this.setId(-1);
         this.setAccountCreation(ACCOUNT_CREATED);
     }
 
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 79df7cb..e266f1f 100644
--- a/src/main/java/de/ids_mannheim/korap/user/User.java
+++ b/src/main/java/de/ids_mannheim/korap/user/User.java
@@ -167,6 +167,10 @@
             return demo;
         }
 
+        public static boolean isDemo(String username) {
+            return new DemoUser().getUsername().equalsIgnoreCase(username);
+        }
+
         public static ShibUser getShibInstance(String eduPersonID, String mail,
                 String cn) {
             ShibUser u = new ShibUser(eduPersonID);
diff --git a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
index 2a8e430..9937c3c 100644
--- a/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
+++ b/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
@@ -166,6 +166,7 @@
 
     }
 
+
     @Setter
     public static class KustvaktArgs {
 
@@ -188,6 +189,6 @@
             this.properties = null;
             this.init = false;
         }
-    }
 
-}
+    }
+}
\ No newline at end of file
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 07108a1..30e8961 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
@@ -13,6 +13,7 @@
 import javax.ws.rs.core.Context;
 import javax.ws.rs.core.UriInfo;
 import javax.ws.rs.ext.Provider;
+import java.security.Principal;
 
 /**
  * Created by hanl on 7/15/14.
@@ -32,12 +33,16 @@
 
         // means that this is the public service
         if (authentication == null || authentication.isEmpty()) {
+            Principal pr = null;
             try {
-                request.getUserPrincipal();
+                pr = request.getUserPrincipal();
             }catch (UnsupportedOperationException e) {
+                // do nothing
+            }
+            if (pr == null)
                 request.setSecurityContext(
                         new KorAPContext(createShorterToken(host, ua)));
-            }
+
         }
         return request;
     }
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 0548cc6..5ef5ee9 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
@@ -4,7 +4,6 @@
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.resources.Permissions;
-import de.ids_mannheim.korap.resources.ResourceFactory;
 import de.ids_mannheim.korap.resources.VirtualCollection;
 import de.ids_mannheim.korap.security.ac.PolicyBuilder;
 import de.ids_mannheim.korap.user.Attributes;
@@ -20,9 +19,6 @@
     @Override
     public void load() throws KustvaktException {
         if (BeanConfiguration.hasContext()) {
-            int uid = (Integer) KustvaktConfiguration.KUSTVAKT_USER
-                    .get(Attributes.ID);
-
             User user = User.UserFactory
                     .toUser(KustvaktConfiguration.KUSTVAKT_USER);
 
@@ -30,22 +26,26 @@
             CollectionQueryBuilder3 bui = new CollectionQueryBuilder3();
             bui.addQuery("creationDate since 1775");
 
-            VirtualCollection c1 = ResourceFactory
-                    .createCollection("Weimarer Werke", bui.toJSON(), uid);
+            VirtualCollection c1 = new VirtualCollection();
+            c1.setName("Weimarer Werke");
+            c1.addField(Attributes.QUERY, bui.toJSON());
+
             c1.setDescription("Goethe-Werke in Weimar (seit 1775)");
 
             bui = new CollectionQueryBuilder3();
             bui.addQuery("textType = Aphorismus");
 
-            VirtualCollection c2 = ResourceFactory
-                    .createCollection("Aphorismen", bui.toJSON(), uid);
+            VirtualCollection c2 = new VirtualCollection();
+            c2.setName("Aphorismen");
+            c2.addField(Attributes.QUERY, bui.toJSON());
             c2.setDescription("Aphorismentexte Goethes");
 
             bui = new CollectionQueryBuilder3();
             bui.addQuery("title ~ \"Werther\"");
 
-            VirtualCollection c3 = ResourceFactory
-                    .createCollection("Werther", bui.toJSON(), uid);
+            VirtualCollection c3 = new VirtualCollection();
+            c3.setName("Werther");
+            c3.addField(Attributes.QUERY, bui.toJSON());
             c3.setDescription("Goethe - Die Leiden des jungen Werther");
 
             PolicyBuilder b = new PolicyBuilder(user);
@@ -53,6 +53,10 @@
             b.setResources(c1, c2, c3);
             b.setConditions("public");
             b.create();
+
+//            ConditionManagement c = new ConditionManagement(user);
+//            c.addUser(User.UserFactory.getDemoUser().getUsername(),
+//                    new PolicyCondition("public"), false);
         }
     }
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
index 3ad501c..7cf1e68 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/PolicyLoader.java
@@ -21,7 +21,7 @@
                     .toUser(KustvaktConfiguration.KUSTVAKT_USER);
             PolicyBuilder builder = new PolicyBuilder(user);
             builder.addCondition("public");
-            builder.setResources(new Corpus("GOE", user.getId()));
+            builder.setResources(new Corpus("GOE"));
             builder.setPermissions(Permissions.PERMISSIONS.ALL);
             builder.create();
 
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java b/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
index 04ecd95..991e126 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/UserLoader.java
@@ -3,6 +3,8 @@
 import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.user.User;
 
 /**
  * @author hanl
@@ -12,9 +14,13 @@
     @Override
     public void load() throws KustvaktException {
         if (BeanConfiguration.hasContext()) {
-            BeanConfiguration.getBeans().getAuthenticationManager()
-                    .createUserAccount(KustvaktConfiguration.KUSTVAKT_USER,
-                            false);
+            AuthenticationManagerIface manager = BeanConfiguration.getBeans()
+                    .getAuthenticationManager();
+
+            BeanConfiguration.getBeans().getUserDBHandler()
+                    .createAccount(User.UserFactory.getDemoUser());
+            manager.createUserAccount(KustvaktConfiguration.KUSTVAKT_USER,
+                    false);
         }
     }
 
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 d9fec47..bae4c21 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
@@ -275,7 +275,7 @@
     //    }
     @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);
@@ -814,8 +814,7 @@
 
             if (!cache) {
                 collection = ResourceFactory
-                        .getPermanentCollection(cachetmp, name, description,
-                                user.getId());
+                        .getPermanentCollection(cachetmp, name, description);
                 vals = collection.toMap();
                 try {
                     resourceHandler.storeResources(user, collection);
@@ -902,8 +901,7 @@
 
             if (!cache && !user.isDemo()) {
                 collection = ResourceFactory
-                        .getPermanentCollection(cachetmp, name, description,
-                                user.getId());
+                        .getPermanentCollection(cachetmp, name, description);
                 vals = collection.toMap();
                 try {
                     resourceHandler.storeResources(user, collection);
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
index 2f4e4de..973544f 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
@@ -206,7 +206,7 @@
     @GET
     @Path("info")
     @ResourceFilters({ AuthFilter.class, DefaultFilter.class, PiwikFilter.class,
-            BlockingFilter.class, BlockingFilter.class })
+            BlockingFilter.class })
     public Response getStatus(@Context SecurityContext context,
             @QueryParam("scopes") String scopes) {
         TokenContext ctx = (TokenContext) context.getUserPrincipal();
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 80cd425..bd4c675 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
@@ -54,7 +54,7 @@
                 e.getEntity());
     }
 
-    private static String buildNotification(int code, String message,
+    public static String buildNotification(int code, String message,
             String entity) {
         Notifications notif = new Notifications();
         notif.addError(code, message, entity);
@@ -79,6 +79,9 @@
             case StatusCodes.ILLEGAL_ARGUMENT:
                 status = Response.Status.NOT_ACCEPTABLE;
                 break;
+            case StatusCodes.STATUS_OK:
+                status = Response.Status.OK;
+                break;
         }
         return status;
     }
diff --git a/src/main/resources/db/mysql/V0.3__securitydatabase.sql b/src/main/resources/db/mysql/V0.3__securitydatabase.sql
index e74b114..c8f6816 100644
--- a/src/main/resources/db/mysql/V0.3__securitydatabase.sql
+++ b/src/main/resources/db/mysql/V0.3__securitydatabase.sql
@@ -127,7 +127,7 @@
 DELIMITER ;
 
 -- todo: are this automatically adapted when refactoring?
-CREATE INDEX group_index ON group_users(user_id);
+CREATE INDEX group_index ON group_users(user_id, group_id);
 CREATE INDEX policy_index ON group_ref(policy_id);
 CREATE UNIQUE INDEX resource_tree_index ON resource_tree (parent_id, depth, child_id);
 CREATE UNIQUE INDEX param_unique ON param_store (p_key, p_value);
diff --git a/src/main/resources/db/sqlite/V1__Initial_version.sql b/src/main/resources/db/sqlite/V1__Initial_version.sql
index 46eff5e..06663e7 100644
--- a/src/main/resources/db/sqlite/V1__Initial_version.sql
+++ b/src/main/resources/db/sqlite/V1__Initial_version.sql
@@ -1,7 +1,7 @@
 CREATE TABLE IF NOT EXISTS korap_users (
 id INTEGER PRIMARY KEY AUTOINCREMENT,
 username VARCHAR(150) NOT NULL UNIQUE,
-password VARCHAR(100) NOT NULL,
+password VARCHAR(100),
 account_lock boolean NOT NULL,
 account_creation BIGINT NOT NULL,
 -- deprecate this
@@ -308,7 +308,7 @@
 
 -- indices
 -- test unique index constraints
-create index group_index on group_users(user_id);
+create index group_index on group_users(user_id, group_id);
 create index policy_index on group_ref(policy_id);
 create index policy_target on policy_store(target_id);
 create unique index r_tree_index on resource_tree (parent_id, depth, child_id);
diff --git a/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
new file mode 100644
index 0000000..1b3a4ea
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/CollectionLoaderTest.java
@@ -0,0 +1,46 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.ResourceDao;
+import de.ids_mannheim.korap.web.service.CollectionLoader;
+import de.ids_mannheim.korap.web.service.UserLoader;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author hanl
+ * @date 11/02/2016
+ */
+public class CollectionLoaderTest {
+
+    @AfterClass
+    public static void close() {
+        BeanConfiguration.closeApplication();
+    }
+
+    @BeforeClass
+    public static void create() {
+        BeanConfiguration.loadClasspathContext("default-config.xml");
+    }
+
+    @Test
+    public void testCollectionLoader() {
+        ResourceDao dao = new ResourceDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+
+        boolean error = false;
+        UserLoader u = new UserLoader();
+        CollectionLoader l = new CollectionLoader();
+        try {
+            u.load();
+            l.load();
+        }catch (KustvaktException e) {
+            error = true;
+        }
+        assert !error;
+        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
+
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
index d4f2ad5..9c10da4 100644
--- a/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
+++ b/src/test/java/de/ids_mannheim/korap/config/ConfigTest.java
@@ -1,13 +1,10 @@
 package de.ids_mannheim.korap.config;
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.ResourceDao;
-import de.ids_mannheim.korap.resources.VirtualCollection;
-import de.ids_mannheim.korap.security.ac.ResourceFinder;
 import de.ids_mannheim.korap.user.Attributes;
-import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.ServiceVersion;
 import de.ids_mannheim.korap.utils.TimeUtils;
+import de.ids_mannheim.korap.web.Arg;
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
@@ -32,20 +29,6 @@
     }
 
     @Test
-    public void testCollectionLoader() throws KustvaktException {
-        TestHelper.runBootInterfaces();
-        ResourceDao dao = new ResourceDao(
-                BeanConfiguration.getBeans().getPersistenceClient());
-        int size = dao.size();
-        Assert.assertNotEquals("Is not supposed to be zero", 0, size);
-
-        Set<VirtualCollection> set = ResourceFinder.search(User.UserFactory
-                        .toUser(KustvaktConfiguration.KUSTVAKT_USER),
-                VirtualCollection.class);
-        System.out.println("RESULTING SET: " + set);
-    }
-
-    @Test
     public void testServiceVersion() {
         String v = ServiceVersion.getAPIVersion();
         Assert.assertNotEquals("wrong version", "UNKNOWN", v);
@@ -76,6 +59,24 @@
         BeanConfiguration.getBeans().getEncryption()
                 .validateEntry(v, Attributes.EMAIL);
     }
+
+    @Test
+    public void testArgLoader() {
+        String[] args = new String[] { "--port", "8080", "--config",
+                "local.conf", "--init" };
+        Set<Arg> s = Arg.loadArgs(args);
+        assert s.size() == 3;
+
+        for (Arg arg : s) {
+            if (arg instanceof Arg.PortArg)
+                assert ((Arg.PortArg) arg).getValue() == 8080;
+            if (arg instanceof Arg.ConfigArg)
+                assert ((Arg.ConfigArg) arg).getValue().equals("local.conf");
+            if (arg instanceof Arg.InitArg)
+                assert ((Arg.InitArg) arg).getValue();
+        }
+    }
+
 }
 
 
diff --git a/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
new file mode 100644
index 0000000..866a5e1
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/PolicyLoaderTest.java
@@ -0,0 +1,48 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.security.ac.PolicyDao;
+import de.ids_mannheim.korap.web.service.CollectionLoader;
+import de.ids_mannheim.korap.web.service.PolicyLoader;
+import de.ids_mannheim.korap.web.service.UserLoader;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author hanl
+ * @date 11/02/2016
+ */
+public class PolicyLoaderTest {
+
+    @AfterClass
+    public static void close() {
+        BeanConfiguration.closeApplication();
+    }
+
+    @BeforeClass
+    public static void create() {
+        BeanConfiguration.loadClasspathContext("default-config.xml");
+    }
+
+    @Test
+    public void testUserLoader() {
+        boolean error = false;
+        UserLoader u = new UserLoader();
+        CollectionLoader c = new CollectionLoader();
+        PolicyLoader l = new PolicyLoader();
+        try {
+            u.load();
+            c.load();
+            l.load();
+        }catch (KustvaktException e) {
+            error = true;
+        }
+        assert !error;
+
+        PolicyDao dao = new PolicyDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
index cc180f3..faa38ac 100644
--- a/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
+++ b/src/test/java/de/ids_mannheim/korap/config/TestHelper.java
@@ -1,8 +1,10 @@
 package de.ids_mannheim.korap.config;
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.ResourceDao;
 import de.ids_mannheim.korap.interfaces.db.EntityHandlerIface;
 import de.ids_mannheim.korap.interfaces.db.PersistenceClient;
+import de.ids_mannheim.korap.resources.KustvaktResource;
 import de.ids_mannheim.korap.user.Attributes;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.web.service.BootupInterface;
@@ -29,7 +31,8 @@
 
     public static boolean setupAccount() {
         boolean r = BeanConfiguration.hasContext();
-        if (r && BeanConfiguration.getBeans().getUserDBHandler().size() == 0) {
+        if (r && ((KustvaktBaseDaoInterface) BeanConfiguration.getBeans()
+                .getUserDBHandler()).size() == 0) {
             EntityHandlerIface dao = BeanConfiguration.getBeans()
                     .getUserDBHandler();
             Map m = new HashMap<>();
@@ -57,7 +60,8 @@
 
     public static boolean setupSimpleAccount(String username, String password) {
         boolean r = BeanConfiguration.hasContext();
-        if (r && BeanConfiguration.getBeans().getUserDBHandler().size() == 0) {
+        if (r && ((KustvaktBaseDaoInterface) BeanConfiguration.getBeans()
+                .getUserDBHandler()).size() == 0) {
             EntityHandlerIface dao = BeanConfiguration.getBeans()
                     .getUserDBHandler();
             Map m = new HashMap<>();
@@ -184,12 +188,36 @@
                     iface.load();
                 }catch (KustvaktException e) {
                     // don't do anything!
+                    System.out.println(
+                            "Loader instance failed ... exiting programme!");
+                    System.exit(-1);
                 }
             }
         }else
             throw new RuntimeException("Client not setup properly!");
     }
 
+    public static void setupResource(KustvaktResource resource, User user)
+            throws KustvaktException {
+        ResourceDao dao = new ResourceDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+        dao.storeResource(resource, user);
+    }
+
+    public static KustvaktResource getResource(String name)
+            throws KustvaktException {
+        ResourceDao dao = new ResourceDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+        return dao.findbyId(name, getUser());
+    }
+
+    public static void dropResource(String name) throws KustvaktException {
+        ResourceDao dao = new ResourceDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+        dao.deleteResource(name, null);
+
+    }
+
     private TestHelper() {
     }
 
diff --git a/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java b/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
new file mode 100644
index 0000000..8b33f2f
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/config/UserLoaderTest.java
@@ -0,0 +1,42 @@
+package de.ids_mannheim.korap.config;
+
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.handlers.EntityDao;
+import de.ids_mannheim.korap.web.service.UserLoader;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author hanl
+ * @date 11/02/2016
+ */
+public class UserLoaderTest {
+
+    @AfterClass
+    public static void close() {
+        BeanConfiguration.closeApplication();
+    }
+
+    @BeforeClass
+    public static void create() {
+        BeanConfiguration.loadClasspathContext("default-config.xml");
+    }
+
+    @Test
+    public void testUserLoader() {
+        EntityDao dao = new EntityDao(
+                BeanConfiguration.getBeans().getPersistenceClient());
+
+        boolean error = false;
+        UserLoader l = new UserLoader();
+        try {
+            l.load();
+        }catch (KustvaktException e) {
+            error = true;
+        }
+        assert !error;
+        Assert.assertNotEquals("Is not supposed to be zero", 0, dao.size());
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java b/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
index 0b11863..83d6de7 100644
--- a/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
+++ b/src/test/java/de/ids_mannheim/korap/handlers/ResourceDaoTest.java
@@ -1,9 +1,9 @@
+package de.ids_mannheim.korap.handlers;
+
 import de.ids_mannheim.korap.config.BeanConfiguration;
 import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.handlers.ResourceDao;
 import de.ids_mannheim.korap.resources.KustvaktResource;
-import de.ids_mannheim.korap.resources.ResourceFactory;
 import de.ids_mannheim.korap.resources.VirtualCollection;
 import de.ids_mannheim.korap.user.User;
 import org.junit.After;
@@ -25,7 +25,7 @@
 
     @AfterClass
     public static void drop() {
-//        TestHelper.dropUser();
+        //        TestHelper.dropUser();
         BeanConfiguration.closeApplication();
     }
 
@@ -39,7 +39,7 @@
     public void createCollection() throws KustvaktException {
         ResourceDao dao = new ResourceDao(
                 BeanConfiguration.getBeans().getPersistenceClient());
-        VirtualCollection c = ResourceFactory.createCollection("testColl", 1);
+        VirtualCollection c = new VirtualCollection("testColl");
         c.addField("key_1", "this is a test");
         c.addField("key_2", 2);
 
@@ -59,7 +59,7 @@
     public void ResourceDataUpdate() throws KustvaktException {
         ResourceDao dao = new ResourceDao(
                 BeanConfiguration.getBeans().getPersistenceClient());
-        VirtualCollection c = ResourceFactory.createCollection("testColl", 1);
+        VirtualCollection c = new VirtualCollection("testColl");
         c.addField("key_1", "this is a test");
         c.addField("key_2", 2);
 
diff --git a/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java b/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
index efcf6c0..0c2adc1 100644
--- a/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManagerTest.java
@@ -1,6 +1,7 @@
 package de.ids_mannheim.korap.security.auth;
 
 import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.KustvaktBaseDaoInterface;
 import de.ids_mannheim.korap.config.KustvaktConfiguration;
 import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
@@ -47,7 +48,7 @@
         EntityHandlerIface dao = BeanConfiguration.getBeans()
                 .getUserDBHandler();
 
-        assert dao.size() > 0;
+        assert ((KustvaktBaseDaoInterface) dao).size() > 0;
         User check = dao.getAccount(user.getUsername());
         assert check != null;
     }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
index 0bed7ff..6ba0ddc 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/AuthServiceTest.java
@@ -1,11 +1,6 @@
 package de.ids_mannheim.korap.web.service.full;
 
-import de.ids_mannheim.korap.config.BeanConfiguration;
-import de.ids_mannheim.korap.config.TestHelper;
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
 
 /**
  * @author hanl
@@ -15,36 +10,4 @@
 
     //todo: test basicauth via secure connection
 
-    @BeforeClass
-    public static void setup() {
-        BeanConfiguration.loadClasspathContext("default-config.xml");
-        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
-                "de.ids_mannheim.korap.web.filter",
-                "de.ids_mannheim.korap.web.utils");
-        TestHelper.setupAccount();
-    }
-
-    @AfterClass
-    public static void close() {
-        TestHelper.dropUser();
-        BeanConfiguration.closeApplication();
-    }
-
-    @Test
-    public void testKustvaktAuth() {
-
-    }
-
-    @Test
-    public void testDemoAuth() {
-
-    }
-
-    @Test
-    public void testUnauthorizedAuth() {
-
-    }
-
-
-
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
new file mode 100644
index 0000000..4b6f118
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/FilterTest.java
@@ -0,0 +1,61 @@
+package de.ids_mannheim.korap.web.service.full;
+
+import com.sun.jersey.api.client.ClientResponse;
+import de.ids_mannheim.korap.config.BeanConfiguration;
+import de.ids_mannheim.korap.config.TestHelper;
+import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
+import de.ids_mannheim.korap.user.Attributes;
+import de.ids_mannheim.korap.web.service.FastJerseyTest;
+import org.eclipse.jetty.server.Response;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * @author hanl
+ * @date 08/02/2016
+ */
+public class FilterTest extends FastJerseyTest {
+
+    @BeforeClass
+    public static void setup() {
+        BeanConfiguration.loadClasspathContext("default-config.xml");
+        FastJerseyTest.setPackages("de.ids_mannheim.korap.web.service.full",
+                "de.ids_mannheim.korap.web.filter",
+                "de.ids_mannheim.korap.web.utils");
+        TestHelper.setupAccount();
+    }
+
+    @AfterClass
+    public static void close() {
+        TestHelper.dropUser();
+        BeanConfiguration.closeApplication();
+    }
+
+    @Test
+    public void testTestUserAuth() {
+        ClientResponse resp = resource().path(getAPIVersion()).path("user/info")
+                .header(Attributes.AUTHORIZATION, BasicHttpAuth
+                        .encode(TestHelper.getUserCredentials()[0],
+                                TestHelper.getUserCredentials()[1]))
+                .get(ClientResponse.class);
+        assert resp.getStatus() == Response.SC_OK;
+        System.out.println("entity '" + resp.getEntity(String.class) + "'");
+    }
+
+    @Test
+    public void testDemoAuth() {
+        ClientResponse resp = resource().path(getAPIVersion()).path("user/info")
+                .get(ClientResponse.class);
+        assert resp.getStatus() == Response.SC_OK;
+    }
+
+    @Test
+    public void testUnauthorizedAuth() {
+        ClientResponse resp = resource().path(getAPIVersion()).path("user/info")
+                .header(Attributes.AUTHORIZATION,
+                        BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
+                .get(ClientResponse.class);
+        assert resp.getStatus() == Response.SC_UNAUTHORIZED;
+    }
+}
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java
index 377b4e8..45182a6 100644
--- a/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/KustvaktResourceServiceTest.java
@@ -11,6 +11,7 @@
 import de.ids_mannheim.korap.web.service.FastJerseyTest;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -63,6 +64,7 @@
     }
 
     @Test
+    @Ignore
     public void testStats() {
         ClientResponse response = resource().path(getAPIVersion())
                 .path("collection").header(Attributes.AUTHORIZATION,
@@ -77,6 +79,8 @@
         System.out.println("NODE COLLECTIONS" + node);
         String id = node.path(0).path("id").asText();
 
+        System.out.println("ID IS " + id);
+        System.out.println("FROM NODE " + node);
         response = resource().path(getAPIVersion()).path("collection").path(id)
                 .path("stats").header(Attributes.AUTHORIZATION,
                         BasicHttpAuth.encode("kustvakt", "kustvakt2015"))
diff --git a/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceRemoteApiTest.java b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceRemoteApiTest.java
new file mode 100644
index 0000000..bcf5f9a
--- /dev/null
+++ b/src/test/java/de/ids_mannheim/korap/web/service/full/ResourceRemoteApiTest.java
@@ -0,0 +1,17 @@
+package de.ids_mannheim.korap.web.service.full;
+
+import org.junit.Test;
+
+/**
+ * @author hanl
+ * @date 08/02/2016
+ */
+public class ResourceRemoteApiTest {
+
+
+
+    @Test
+    public void testResourceGetFromDemo() {
+
+    }
+}
