Integrated lite and full services and controllers in core.

Change-Id: I34914c89c2266fa02bee1a5b0522c46139b13966
diff --git a/core/Changes b/core/Changes
index 68eb797..be27ad5 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,3 +1,7 @@
+version 0.61.4
+14/11/2018
+   - Integrated lite and full services and controllers in core (margaretha)
+
 version 0.61.3
 22/10/2018
    - Updated jetty, spring and hibernate versions (margaretha)
diff --git a/core/pom.xml b/core/pom.xml
index abe02bb..253b616 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -3,7 +3,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
 	<artifactId>Kustvakt-core</artifactId>
-	<version>0.61.3</version>
+	<version>0.61.4</version>
 
 	<properties>
 		<java.version>1.8</java.version>
@@ -17,36 +17,14 @@
 		<resources>
 			<resource>
 				<directory>src/main/resources</directory>
-				<filtering>true</filtering>
-				<includes>
-					<include>**/*.info</include>
-					<include>**/*.xml</include>
-					<include>**/*.conf</include>
-					<include>**/*.kustvakt</include>
-					<include>**/*.properties</include>
-					<include>**/*.sql</include>
-				</includes>
 			</resource>
 		</resources>
 		<testResources>
 			<testResource>
 				<directory>src/test/resources</directory>
-				<filtering>true</filtering>
-				<includes>
-					<include>**/*.prop</include>
-					<include>**/*.xml</include>
-					<include>**/*.conf</include>
-					<include>**/*.info</include>
-					<include>**/*.properties</include>
-				</includes>
 			</testResource>
 			<testResource>
 				<directory>src/main/resources</directory>
-				<filtering>true</filtering>
-				<includes>
-					<include>**/*.info</include>
-					<include>**/*.properties</include>
-				</includes>
 			</testResource>
 		</testResources>
 		<plugins>
@@ -73,12 +51,20 @@
 					<compilerVersion>${java.version}</compilerVersion>
 					<source>${java.version}</source>
 					<target>${java.version}</target>
+					<processors>
+						<processor>lombok.launch.AnnotationProcessorHider$AnnotationProcessor</processor>
+						<processor>org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor</processor>
+					</processors>
 				</configuration>
 			</plugin>
 
 			<!-- build tests jar, so extensions can use fastjerseytest class to build 
 				rest tests -->
-			<!-- <plugin>
+			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> 
+				<version>3.0.1</version> <executions> <execution> <id>attach-sources</id> 
+				<goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> -->
+			<!-- Generate source jar -->
+			<plugin>
 				<groupId>org.apache.maven.plugins</groupId>
 				<artifactId>maven-source-plugin</artifactId>
 				<version>3.0.1</version>
@@ -90,43 +76,17 @@
 						</goals>
 					</execution>
 				</executions>
-			</plugin> -->
-			<!-- Generate source jar -->
-		    <plugin>
-		      <groupId>org.apache.maven.plugins</groupId>
-		      <artifactId>maven-source-plugin</artifactId>
-		      <version>3.0.1</version>
-		      <executions>
-		        <execution>
-		          <id>attach-sources</id>
-		          <goals>
-		            <goal>jar</goal>
-		          </goals>
-		        </execution>
-		      </executions>
-		    </plugin>
-			<!-- <plugin>
-				<groupId>org.apache.maven.plugins</groupId>
-				<artifactId>maven-surefire-plugin</artifactId>
-				<version>2.20.1</version>
-
-				<configuration>
-					<reuseForks>false</reuseForks>
-					<forkCount>2</forkCount>
-					<threadCount>10</threadCount>
-					<argLine>-Xmx1024m -XX:MaxPermSize=256m</argLine>
-
-					<excludes>
-						<exclude>**/*APITest.java</exclude>
-					</excludes>
-					<includes>
-						<include>de/ids_mannheim/korap/**/*.java</include>
-					</includes>
-				</configuration>
-			</plugin> -->
+			</plugin>
+			<!-- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> 
+				<version>2.20.1</version> <configuration> <reuseForks>false</reuseForks> 
+				<forkCount>2</forkCount> <threadCount>10</threadCount> <argLine>-Xmx1024m 
+				-XX:MaxPermSize=256m</argLine> <excludes> <exclude>**/*APITest.java</exclude> 
+				</excludes> <includes> <include>de/ids_mannheim/korap/**/*.java</include> 
+				</includes> </configuration> </plugin> -->
 		</plugins>
 	</build>
 	<dependencies>
+		<!-- Jersey -->
 		<dependency>
 			<groupId>com.sun.jersey</groupId>
 			<artifactId>jersey-bundle</artifactId>
@@ -170,20 +130,27 @@
 				</exclusion>
 			</exclusions>
 		</dependency>
-		<!-- EM:done -->
+
+		<!-- JSON -->
 		<dependency>
-			<groupId>com.sun.jersey.jersey-test-framework</groupId>
-			<artifactId>jersey-test-framework-core</artifactId>
+			<groupId>com.sun.jersey</groupId>
+			<artifactId>jersey-json</artifactId>
 			<version>${jersey.version}</version>
-			<scope>test</scope>
 		</dependency>
 		<dependency>
-			<groupId>com.sun.jersey.jersey-test-framework</groupId>
-			<artifactId>jersey-test-framework-grizzly</artifactId>
-			<version>${jersey.version}</version>
-			<scope>test</scope>
+			<groupId>net.minidev</groupId>
+			<artifactId>json-smart</artifactId>
+			<version>1.0.9</version>
 		</dependency>
-		<!-- EM: Logging -->
+
+		<!-- Flyway -->
+		<dependency>
+			<groupId>org.flywaydb</groupId>
+			<artifactId>flyway-core</artifactId>
+			<version>4.0</version>
+		</dependency>
+
+		<!-- Logging -->
 		<dependency>
 			<groupId>org.apache.logging.log4j</groupId>
 			<artifactId>log4j-api</artifactId>
@@ -195,26 +162,36 @@
 			<version>2.11.0</version>
 		</dependency>
 		<dependency>
-		    <groupId>org.apache.logging.log4j</groupId>
-		    <artifactId>log4j-slf4j-impl</artifactId>
-		    <version>2.11.0</version>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-slf4j-impl</artifactId>
+			<version>2.11.0</version>
 		</dependency>
 		<dependency>
-		    <groupId>org.apache.logging.log4j</groupId>
-		    <artifactId>log4j-jul</artifactId>
-		    <version>2.11.0</version>
-		    <exclusions>
-		    	<exclusion>
+			<groupId>org.apache.logging.log4j</groupId>
+			<artifactId>log4j-jul</artifactId>
+			<version>2.11.0</version>
+			<exclusions>
+				<exclusion>
 					<groupId>org.slf4j</groupId>
 					<artifactId>slf4j-api</artifactId>
 				</exclusion>
-		    </exclusions>
+			</exclusions>
 		</dependency>
 		<dependency>
 			<groupId>org.slf4j</groupId>
 			<artifactId>slf4j-api</artifactId>
-		    <version>1.7.25</version>
+			<version>1.7.25</version>
 		</dependency>
+		
+		<!-- Java Assist -->
+		<dependency>
+			<groupId>org.javassist</groupId>
+			<artifactId>javassist</artifactId>
+			<version>3.22.0-GA</version>
+		</dependency>
+
+		<!-- EM:done -->
+
 		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
@@ -233,7 +210,7 @@
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Koral</artifactId>
-			<version>0.31</version>
+			<version>[0.31,)</version>
 			<exclusions>
 				<exclusion>
 					<groupId>org.eclipse.jetty</groupId>
@@ -285,7 +262,7 @@
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Krill</artifactId>
-			<version>0.58.1</version>
+			<version>[0.58.1,)</version>
 			<exclusions>
 				<exclusion>
 					<groupId>org.xerial</groupId>
@@ -314,6 +291,8 @@
 			<artifactId>reflections</artifactId>
 			<version>0.9.10</version>
 		</dependency>
+
+		<!-- Spring -->
 		<dependency>
 			<groupId>org.springframework</groupId>
 			<artifactId>spring-core</artifactId>
@@ -334,6 +313,27 @@
 			<artifactId>spring-orm</artifactId>
 			<version>${spring-framework.version}</version>
 		</dependency>
+
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>${spring-framework.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-tx</artifactId>
+			<version>${spring-framework.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-core</artifactId>
+			<version>${spring-framework.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework.security</groupId>
+			<artifactId>spring-security-web</artifactId>
+			<version>${spring-framework.version}</version>
+		</dependency>
 		<!-- EM: done -->
 		<dependency>
 			<groupId>org.springframework</groupId>
@@ -407,34 +407,15 @@
 			<version>3.2.1</version>
 		</dependency>
 
-		<!-- not part of public release
-		<dependency>
-			<groupId>KorAP-graphDB</groupId>
-			<artifactId>KorAP-graphDB</artifactId>
-			<version>1.0-SNAPSHOT</version>
-			<exclusions>
-				<exclusion>
-					<groupId>org.antlr</groupId>
-					<artifactId>antlr4-runtime</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.glassfish.jersey.core</groupId>
-					<artifactId>jersey-client</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.glassfish.jersey.containers</groupId>
-					<artifactId>jersey-container-grizzly2-http</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.glassfish.jersey.core</groupId>
-					<artifactId>jersey-common</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>org.glassfish.jersey.core</groupId>
-					<artifactId>jersey-server</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency> -->
+		<!-- not part of public release <dependency> <groupId>KorAP-graphDB</groupId> 
+			<artifactId>KorAP-graphDB</artifactId> <version>1.0-SNAPSHOT</version> <exclusions> 
+			<exclusion> <groupId>org.antlr</groupId> <artifactId>antlr4-runtime</artifactId> 
+			</exclusion> <exclusion> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> 
+			</exclusion> <exclusion> <groupId>org.glassfish.jersey.containers</groupId> 
+			<artifactId>jersey-container-grizzly2-http</artifactId> </exclusion> <exclusion> 
+			<groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-common</artifactId> 
+			</exclusion> <exclusion> <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-server</artifactId> 
+			</exclusion> </exclusions> </dependency> -->
 		<dependency>
 			<groupId>org.apache.httpcomponents</groupId>
 			<artifactId>httpclient</artifactId>
@@ -446,12 +427,20 @@
 			<version>2.6</version>
 		</dependency>
 
+		<!-- Hibernate -->
 		<dependency>
 			<groupId>org.hibernate</groupId>
 			<artifactId>hibernate-ehcache</artifactId>
 			<version>${hibernate.version}</version>
 		</dependency>
 		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>hibernate-jpamodelgen</artifactId>
+			<version>${hibernate.version}</version>
+			<scope>provided</scope>
+		</dependency>
+		
+		<dependency>
 			<groupId>javax.servlet</groupId>
 			<artifactId>javax.servlet-api</artifactId>
 			<version>4.0.1</version>
diff --git a/full/src/main/java/de/ids_mannheim/de/init/Initializator.java b/core/src/main/java/de/ids_mannheim/de/init/Initializator.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/de/init/Initializator.java
rename to core/src/main/java/de/ids_mannheim/de/init/Initializator.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java b/core/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
similarity index 90%
rename from full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
rename to core/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
index 4f995cb..b6fd448 100644
--- a/full/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
+++ b/core/src/main/java/de/ids_mannheim/korap/annotation/AnnotationParser.java
@@ -4,7 +4,9 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
+import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Set;
@@ -14,6 +16,8 @@
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
 import org.springframework.stereotype.Component;
 
 import de.ids_mannheim.korap.constant.AnnotationType;
@@ -40,25 +44,23 @@
     private Set<Annotation> values = new HashSet<>();
 
     public void run () throws IOException {
-        String dir = "annotation-scripts/foundries";
-        if (dir.isEmpty()) return;
+        PathMatchingResourcePatternResolver resolver =
+                new PathMatchingResourcePatternResolver(
+                        getClass().getClassLoader());
+        Resource[] resources = resolver
+                .getResources("classpath:annotation-scripts/foundries/*.js");
 
-        File d = new File(dir);
-        if (!d.isDirectory()) {
-            throw new IOException("Directory " + dir + " is not valid");
-        }
+        if (resources.length < 1) return;
 
-        for (File file : d.listFiles()) {
-            if (!file.exists()) {
-                throw new IOException("File " + file + " is not found.");
-            }
-            readFile(file);
+        for (Resource r : resources) {
+            log.debug(r.getFilename());
+            readFile(r.getInputStream());
         }
     }
 
-    private void readFile (File file) throws IOException {
-        BufferedReader br = new BufferedReader(
-                new InputStreamReader(new FileInputStream(file)), 1024);
+    private void readFile (InputStream inputStream) throws IOException {
+        BufferedReader br =
+                new BufferedReader(new InputStreamReader(inputStream), 1024);
 
         foundry = null;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java b/core/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
rename to core/src/main/java/de/ids_mannheim/korap/annotation/ArrayVariables.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java b/core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
similarity index 93%
rename from full/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java
rename to core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
index 140ef6b..47d0738 100644
--- a/full/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationIface.java
+++ b/core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationIface.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.interfaces;
+package de.ids_mannheim.korap.authentication;
 
 import java.util.Map;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java b/core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
similarity index 96%
rename from full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
rename to core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
index e9e6764..a56cc76 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
+++ b/core/src/main/java/de/ids_mannheim/korap/authentication/AuthenticationManager.java
@@ -10,7 +10,6 @@
 import de.ids_mannheim.korap.constant.AuthenticationMethod;
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.user.Userdata;
@@ -24,7 +23,11 @@
     private Map<TokenType, AuthenticationIface> providers;
 
     public AuthenticationManager () {
-        super("id_tokens", "key:id_tokens");
+        super();
+    }
+    
+    public AuthenticationManager (String cache) {
+        super(cache, "key:"+cache);
         this.providers = new HashMap<>();
     }
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java b/core/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
rename to core/src/main/java/de/ids_mannheim/korap/authentication/http/AuthorizationData.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/http/HttpAuthorizationHandler.java b/core/src/main/java/de/ids_mannheim/korap/authentication/http/HttpAuthorizationHandler.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/authentication/http/HttpAuthorizationHandler.java
rename to core/src/main/java/de/ids_mannheim/korap/authentication/http/HttpAuthorizationHandler.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java b/core/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
rename to core/src/main/java/de/ids_mannheim/korap/authentication/http/TransferEncoding.java
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
index dfe6443..b22cb70 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktCacheable.java
@@ -29,6 +29,10 @@
         this.prefix = prefix;
         this.name = cache_name;
     }
+    
+    public KustvaktCacheable () {
+        // TODO Auto-generated constructor stub
+    }
 
     private static Cache getCache(String name) {
         return CacheManager.getInstance().getCache(name);
diff --git a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
index 5ff29ea..7aab419 100644
--- a/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
+++ b/core/src/main/java/de/ids_mannheim/korap/config/KustvaktConfiguration.java
@@ -5,6 +5,7 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
@@ -111,8 +112,8 @@
         currentVersion = properties.getProperty("current.api.version", "v1.0");
         String supportedVersions =
                 properties.getProperty("supported.api.version", "");
-        this.supportedVersions = Arrays.stream(supportedVersions.split(" "))
-                .collect(Collectors.toSet());
+        
+        this.supportedVersions = new HashSet<>(Arrays.asList(supportedVersions.split(" ")));
         this.supportedVersions.add(currentVersion);
 
         baseURL = properties.getProperty("kustvakt.base.url", "/api/*");
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java b/core/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
rename to core/src/main/java/de/ids_mannheim/korap/constant/AnnotationType.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java b/core/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
rename to core/src/main/java/de/ids_mannheim/korap/constant/AuthenticationMethod.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java b/core/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
rename to core/src/main/java/de/ids_mannheim/korap/constant/AuthenticationScheme.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Scope.java b/core/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
similarity index 93%
rename from full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Scope.java
rename to core/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
index 0dc20d5..5cd1293 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/constant/OAuth2Scope.java
+++ b/core/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.oauth2.constant;
+package de.ids_mannheim.korap.constant;
 
 public enum OAuth2Scope {
     
diff --git a/full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java b/core/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
rename to core/src/main/java/de/ids_mannheim/korap/constant/TokenType.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/AdminDao.java b/core/src/main/java/de/ids_mannheim/korap/dao/AdminDao.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dao/AdminDao.java
rename to core/src/main/java/de/ids_mannheim/korap/dao/AdminDao.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java b/core/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
rename to core/src/main/java/de/ids_mannheim/korap/dao/AnnotationDao.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java b/core/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
rename to core/src/main/java/de/ids_mannheim/korap/dao/ResourceDao.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java b/core/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
rename to core/src/main/java/de/ids_mannheim/korap/dto/FoundryDto.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/LayerDto.java b/core/src/main/java/de/ids_mannheim/korap/dto/LayerDto.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dto/LayerDto.java
rename to core/src/main/java/de/ids_mannheim/korap/dto/LayerDto.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java b/core/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
rename to core/src/main/java/de/ids_mannheim/korap/dto/converter/AnnotationConverter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java b/core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
rename to core/src/main/java/de/ids_mannheim/korap/encryption/RandomCodeGenerator.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/Annotation.java b/core/src/main/java/de/ids_mannheim/korap/entity/Annotation.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/entity/Annotation.java
rename to core/src/main/java/de/ids_mannheim/korap/entity/Annotation.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/AnnotationKey.java b/core/src/main/java/de/ids_mannheim/korap/entity/AnnotationKey.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/entity/AnnotationKey.java
rename to core/src/main/java/de/ids_mannheim/korap/entity/AnnotationKey.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/AnnotationLayer.java b/core/src/main/java/de/ids_mannheim/korap/entity/AnnotationLayer.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/entity/AnnotationLayer.java
rename to core/src/main/java/de/ids_mannheim/korap/entity/AnnotationLayer.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/entity/Resource.java b/core/src/main/java/de/ids_mannheim/korap/entity/Resource.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/entity/Resource.java
rename to core/src/main/java/de/ids_mannheim/korap/entity/Resource.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java b/core/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
rename to core/src/main/java/de/ids_mannheim/korap/interfaces/EncryptionIface.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java b/core/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
rename to core/src/main/java/de/ids_mannheim/korap/interfaces/EntityHandlerIface.java
diff --git a/core/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java b/core/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
new file mode 100644
index 0000000..da12bfd
--- /dev/null
+++ b/core/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
@@ -0,0 +1,13 @@
+package de.ids_mannheim.korap.oauth2.service;
+
+import de.ids_mannheim.korap.constant.OAuth2Scope;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.security.context.TokenContext;
+
+public interface OAuth2ScopeService {
+
+    
+    void verifyScope (TokenContext context, OAuth2Scope requiredScope)
+            throws KustvaktException;
+
+}
\ No newline at end of file
diff --git a/full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java b/core/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
rename to core/src/main/java/de/ids_mannheim/korap/security/context/KustvaktContext.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java b/core/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
rename to core/src/main/java/de/ids_mannheim/korap/security/context/TokenContext.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
rename to core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/AnnotationService.java b/core/src/main/java/de/ids_mannheim/korap/service/AnnotationService.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/service/AnnotationService.java
rename to core/src/main/java/de/ids_mannheim/korap/service/AnnotationService.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/SearchService.java b/core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/service/SearchService.java
rename to core/src/main/java/de/ids_mannheim/korap/service/SearchService.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java b/core/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
rename to core/src/main/java/de/ids_mannheim/korap/web/KustvaktResponseHandler.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/AnnotationController.java b/core/src/main/java/de/ids_mannheim/korap/web/controller/AnnotationController.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/controller/AnnotationController.java
rename to core/src/main/java/de/ids_mannheim/korap/web/controller/AnnotationController.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java b/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
similarity index 99%
rename from full/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
rename to core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
index e65ae07..90e9435 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/controller/SearchController.java
@@ -24,13 +24,13 @@
 
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.service.SearchService;
-import de.ids_mannheim.korap.web.KustvaktResponseHandler;
 import de.ids_mannheim.korap.web.APIVersionFilter;
+import de.ids_mannheim.korap.web.KustvaktResponseHandler;
 import de.ids_mannheim.korap.web.filter.AuthenticationFilter;
 import de.ids_mannheim.korap.web.filter.DemoUserFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java b/core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
rename to core/src/main/java/de/ids_mannheim/korap/web/controller/StatisticController.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/AuthenticationFilter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/BlockingFilter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/DemoFilter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/DemoUserFilter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/NonDemoBlockingFilter.java
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java b/core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
rename to core/src/main/java/de/ids_mannheim/korap/web/filter/PiwikFilter.java
diff --git a/full/annotation-scripts/foundries/base.js b/core/src/main/resources/annotation-scripts/foundries/base.js
similarity index 100%
rename from full/annotation-scripts/foundries/base.js
rename to core/src/main/resources/annotation-scripts/foundries/base.js
diff --git a/full/annotation-scripts/foundries/cnx.js b/core/src/main/resources/annotation-scripts/foundries/cnx.js
similarity index 100%
rename from full/annotation-scripts/foundries/cnx.js
rename to core/src/main/resources/annotation-scripts/foundries/cnx.js
diff --git a/full/annotation-scripts/foundries/corenlp.js b/core/src/main/resources/annotation-scripts/foundries/corenlp.js
similarity index 100%
rename from full/annotation-scripts/foundries/corenlp.js
rename to core/src/main/resources/annotation-scripts/foundries/corenlp.js
diff --git a/full/annotation-scripts/foundries/dereko.js b/core/src/main/resources/annotation-scripts/foundries/dereko.js
similarity index 100%
rename from full/annotation-scripts/foundries/dereko.js
rename to core/src/main/resources/annotation-scripts/foundries/dereko.js
diff --git a/full/annotation-scripts/foundries/drukola.js b/core/src/main/resources/annotation-scripts/foundries/drukola.js
similarity index 100%
rename from full/annotation-scripts/foundries/drukola.js
rename to core/src/main/resources/annotation-scripts/foundries/drukola.js
diff --git a/full/annotation-scripts/foundries/lwc.js b/core/src/main/resources/annotation-scripts/foundries/lwc.js
similarity index 100%
rename from full/annotation-scripts/foundries/lwc.js
rename to core/src/main/resources/annotation-scripts/foundries/lwc.js
diff --git a/full/annotation-scripts/foundries/malt.js b/core/src/main/resources/annotation-scripts/foundries/malt.js
similarity index 100%
rename from full/annotation-scripts/foundries/malt.js
rename to core/src/main/resources/annotation-scripts/foundries/malt.js
diff --git a/full/annotation-scripts/foundries/marmot.js b/core/src/main/resources/annotation-scripts/foundries/marmot.js
similarity index 100%
rename from full/annotation-scripts/foundries/marmot.js
rename to core/src/main/resources/annotation-scripts/foundries/marmot.js
diff --git a/full/annotation-scripts/foundries/mate.js b/core/src/main/resources/annotation-scripts/foundries/mate.js
similarity index 100%
rename from full/annotation-scripts/foundries/mate.js
rename to core/src/main/resources/annotation-scripts/foundries/mate.js
diff --git a/full/annotation-scripts/foundries/opennlp.js b/core/src/main/resources/annotation-scripts/foundries/opennlp.js
similarity index 100%
rename from full/annotation-scripts/foundries/opennlp.js
rename to core/src/main/resources/annotation-scripts/foundries/opennlp.js
diff --git a/full/annotation-scripts/foundries/schreibgebrauch.js b/core/src/main/resources/annotation-scripts/foundries/schreibgebrauch.js
similarity index 100%
rename from full/annotation-scripts/foundries/schreibgebrauch.js
rename to core/src/main/resources/annotation-scripts/foundries/schreibgebrauch.js
diff --git a/full/annotation-scripts/foundries/treetagger.js b/core/src/main/resources/annotation-scripts/foundries/treetagger.js
similarity index 100%
rename from full/annotation-scripts/foundries/treetagger.js
rename to core/src/main/resources/annotation-scripts/foundries/treetagger.js
diff --git a/full/annotation-scripts/foundries/xip.js b/core/src/main/resources/annotation-scripts/foundries/xip.js
similarity index 100%
rename from full/annotation-scripts/foundries/xip.js
rename to core/src/main/resources/annotation-scripts/foundries/xip.js
diff --git a/full/annotation-scripts/variables/negraedges.js b/core/src/main/resources/annotation-scripts/variables/negraedges.js
similarity index 100%
rename from full/annotation-scripts/variables/negraedges.js
rename to core/src/main/resources/annotation-scripts/variables/negraedges.js
diff --git a/full/annotation-scripts/variables/negranodes.js b/core/src/main/resources/annotation-scripts/variables/negranodes.js
similarity index 100%
rename from full/annotation-scripts/variables/negranodes.js
rename to core/src/main/resources/annotation-scripts/variables/negranodes.js
diff --git a/full/annotation-scripts/variables/stts.js b/core/src/main/resources/annotation-scripts/variables/stts.js
similarity index 100%
rename from full/annotation-scripts/variables/stts.js
rename to core/src/main/resources/annotation-scripts/variables/stts.js
diff --git a/full/Changes b/full/Changes
index 10684e1..647f863 100644
--- a/full/Changes
+++ b/full/Changes
@@ -1,3 +1,7 @@
+# version 0.61.4
+14/11/2018
+   - Integrated lite and full services and controllers in core (margaretha)
+   
 # version 0.61.3
 17/10/2018
     - Updated NamedVCLoader to be optional (margaretha)
diff --git a/full/pom.xml b/full/pom.xml
index ba18faf..71252ac 100644
--- a/full/pom.xml
+++ b/full/pom.xml
@@ -3,7 +3,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
 	<artifactId>Kustvakt-full</artifactId>
-	<version>0.61.3</version>
+	<version>0.61.4</version>
 	<properties>
 		<java.version>1.8</java.version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -185,7 +185,7 @@
 				<artifactId>maven-surefire-plugin</artifactId>
 				<version>2.22.1</version>
 				<configuration>
-          <useSystemClassLoader>false</useSystemClassLoader>
+                    <useSystemClassLoader>false</useSystemClassLoader>
 					<reuseForks>true</reuseForks>
 					<forkCount>1</forkCount>
 					<threadCount>10</threadCount>
@@ -208,7 +208,7 @@
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Kustvakt-core</artifactId>
-			<version>0.61.3</version>
+			<version>[0.61.4,)</version>
 		</dependency>
 		<!-- LDAP -->
 		<dependency>
@@ -251,12 +251,6 @@
 			<version>${hibernate.version}</version>
 		</dependency>
 
-		<dependency>
-			<groupId>org.javassist</groupId>
-			<artifactId>javassist</artifactId>
-			<version>3.22.0-GA</version>
-		</dependency>
-
 		<!-- MySql -->
 		<dependency>
 			<groupId>mysql</groupId>
@@ -278,34 +272,6 @@
 			<scope>test</scope>
 		</dependency>
 
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-json</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-
-		<!-- Spring -->
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-jdbc</artifactId>
-			<version>${spring-framework.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-tx</artifactId>
-			<version>${spring-framework.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.security</groupId>
-			<artifactId>spring-security-core</artifactId>
-			<version>${spring-framework.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.springframework.security</groupId>
-			<artifactId>spring-security-web</artifactId>
-			<version>${spring-framework.version}</version>
-		</dependency>
-
 		<!-- velocity -->
 		<dependency>
 			<groupId>org.apache.velocity</groupId>
@@ -329,13 +295,6 @@
 			<version>1.1.1</version>
 		</dependency>
 
-		<!-- Flyway -->
-		<dependency>
-			<groupId>org.flywaydb</groupId>
-			<artifactId>flyway-core</artifactId>
-			<version>4.0</version>
-		</dependency>
-
 		<!-- OAuth -->
 		<dependency>
 			<groupId>org.apache.oltu.oauth2</groupId>
diff --git a/full/src/main/java/de/ids_mannheim/de/init/InitializatorImpl.java b/full/src/main/java/de/ids_mannheim/de/init/InitializatorImpl.java
index 318f47e..9f0e27d 100644
--- a/full/src/main/java/de/ids_mannheim/de/init/InitializatorImpl.java
+++ b/full/src/main/java/de/ids_mannheim/de/init/InitializatorImpl.java
@@ -8,8 +8,8 @@
 import de.ids_mannheim.korap.annotation.AnnotationParser;
 import de.ids_mannheim.korap.annotation.FreeResourceParser;
 import de.ids_mannheim.korap.config.NamedVCLoader;
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.dao.AccessScopeDao;
 import de.ids_mannheim.korap.util.QueryException;
 
@@ -54,7 +54,11 @@
      * @see de.ids_mannheim.de.init.Initializator#initTest()
      */
     @Override
-    public void initTest () throws IOException, KustvaktException {
+    public void initTest () {
+        setInitialAccessScope();
+    }
+    
+    public void initAnnotationTest () throws IOException, KustvaktException {
         setInitialAccessScope();
         annotationParser.run();
         resourceParser.run();
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
index 77504a5..869b641 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/APIAuthentication.java
@@ -18,7 +18,6 @@
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import net.sf.ehcache.Cache;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
index b90406b..f94ab3f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/BasicAuthentication.java
@@ -15,7 +15,6 @@
 import de.ids_mannheim.korap.dao.UserDao;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.StringUtils;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
index 6aa5b9f..e4e8ac1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/KustvaktAuthenticationManager.java
@@ -33,7 +33,6 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.exceptions.WrappedException;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.interfaces.EntityHandlerIface;
 import de.ids_mannheim.korap.interfaces.ValidatorIface;
@@ -74,6 +73,7 @@
 	
 	public KustvaktAuthenticationManager(EntityHandlerIface userdb, EncryptionIface crypto,
 			FullConfiguration config, AuditingIface auditer, Collection<UserDataDbIface> userdatadaos) {
+	    super("id_tokens");
 		this.entHandler = userdb;
 		this.config = config;
 		this.crypto = crypto;
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
index d203b51..a180921 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/OAuth2Authentication.java
@@ -9,10 +9,9 @@
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.oauth2.dao.AccessTokenDao;
 import de.ids_mannheim.korap.oauth2.entity.AccessToken;
-import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
+import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeServiceImpl;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.user.User;
 
@@ -22,7 +21,7 @@
     @Autowired
     private AccessTokenDao accessDao;
     @Autowired
-    private OAuth2ScopeService scopeService;
+    private OAuth2ScopeServiceImpl scopeService;
 
     @Override
     public TokenContext getTokenContext (String authToken)
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
index 1bb4c6d..af8e953 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
+++ b/full/src/main/java/de/ids_mannheim/korap/authentication/SessionAuthentication.java
@@ -4,7 +4,6 @@
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.interfaces.AuthenticationIface;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.config.Attributes;
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
index aa158a3..de0cfac 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/dao/AccessScopeDao.java
@@ -13,7 +13,8 @@
 import org.springframework.stereotype.Repository;
 import org.springframework.transaction.annotation.Transactional;
 
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
+import de.ids_mannheim.korap.constant.OAuth2Scope;
+import de.ids_mannheim.korap.oauth2.entity.AccessScope;
 import de.ids_mannheim.korap.oauth2.entity.AccessScope;
 
 @Repository
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
index 8fb2e0d..15d9da5 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/entity/AccessScope.java
@@ -11,7 +11,7 @@
 import javax.persistence.ManyToMany;
 import javax.persistence.Table;
 
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import lombok.Getter;
 import lombok.Setter;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
index 591e41d..e73421b 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/oltu/service/OltuTokenService.java
@@ -25,6 +25,7 @@
 import de.ids_mannheim.korap.oauth2.dao.AccessTokenDao;
 import de.ids_mannheim.korap.oauth2.dao.RefreshTokenDao;
 import de.ids_mannheim.korap.oauth2.entity.AccessScope;
+import de.ids_mannheim.korap.oauth2.entity.AccessScope;
 import de.ids_mannheim.korap.oauth2.entity.AccessToken;
 import de.ids_mannheim.korap.oauth2.entity.Authorization;
 import de.ids_mannheim.korap.oauth2.entity.OAuth2Client;
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
deleted file mode 100644
index 4cafce0..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package de.ids_mannheim.korap.oauth2.service;
-
-import java.util.Collection;
-import java.util.Set;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
-import de.ids_mannheim.korap.oauth2.entity.AccessScope;
-import de.ids_mannheim.korap.security.context.TokenContext;
-
-public class DummyOAuth2ScopeServiceImpl implements OAuth2ScopeService {
-
-    @Override
-    public Set<AccessScope> convertToAccessScope (Collection<String> scopes)
-            throws KustvaktException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public String convertAccessScopesToString (Set<AccessScope> scopes) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Set<String> convertAccessScopesToStringSet (
-            Set<AccessScope> scopes) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public Set<String> filterScopes (Set<String> scopes,
-            Set<String> defaultScopes) {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    @Override
-    public void verifyScope (TokenContext context, OAuth2Scope requiredScope)
-            throws KustvaktException {
-        // TODO Auto-generated method stub
-
-    }
-
-    @Override
-    public Set<AccessScope> verifyRefreshScope (Set<String> requestScopes,
-            Set<AccessScope> originalScopes) throws KustvaktException {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
index 37e89ef..227cf0e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2AuthorizationService.java
@@ -28,7 +28,7 @@
     @Autowired
     protected OAuth2ClientService clientService;
     @Autowired
-    protected OAuth2ScopeService scopeService;
+    protected OAuth2ScopeServiceImpl scopeService;
     @Autowired
     private AuthorizationDao authorizationDao;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
deleted file mode 100644
index 46d21eb..0000000
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package de.ids_mannheim.korap.oauth2.service;
-
-import java.util.Collection;
-import java.util.Set;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
-import de.ids_mannheim.korap.oauth2.entity.AccessScope;
-import de.ids_mannheim.korap.security.context.TokenContext;
-
-public interface OAuth2ScopeService {
-
-    /**
-     * Converts a set of scope strings to a set of {@link AccessScope}
-     * 
-     * @param scopes
-     * @return
-     * @throws KustvaktException
-     */
-    Set<AccessScope> convertToAccessScope (Collection<String> scopes)
-            throws KustvaktException;
-
-    String convertAccessScopesToString (Set<AccessScope> scopes);
-
-    Set<String> convertAccessScopesToStringSet (Set<AccessScope> scopes);
-
-    /**
-     * Simple reduction of requested scopes, i.e. excluding any scopes
-     * that are not default scopes for a specific authorization grant.
-     * 
-     * @param scopes
-     * @param defaultScopes
-     * @return accepted scopes
-     */
-    Set<String> filterScopes (Set<String> scopes, Set<String> defaultScopes);
-
-    void verifyScope (TokenContext context, OAuth2Scope requiredScope)
-            throws KustvaktException;
-
-    /**
-     * Verify scopes given in a refresh request. The scopes must not
-     * include other scopes than those authorized in the original
-     * access token issued together with the refresh token.
-     * 
-     * @param requestScopes
-     *            requested scopes
-     * @param originalScopes
-     *            authorized scopes
-     * @return a set of requested {@link AccessScope}
-     * @throws KustvaktException
-     */
-    Set<AccessScope> verifyRefreshScope (Set<String> requestScopes,
-            Set<AccessScope> originalScopes) throws KustvaktException;
-
-}
\ No newline at end of file
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
index 387bf6d..7632032 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2ScopeServiceImpl.java
@@ -11,14 +11,15 @@
 import org.springframework.beans.factory.annotation.Autowired;
 
 import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.dao.AdminDao;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.oauth2.constant.OAuth2Error;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.dao.AccessScopeDao;
 import de.ids_mannheim.korap.oauth2.entity.AccessScope;
+import de.ids_mannheim.korap.oauth2.entity.AccessScope;
 import de.ids_mannheim.korap.security.context.TokenContext;
 
 public class OAuth2ScopeServiceImpl implements OAuth2ScopeService {
@@ -29,10 +30,13 @@
     @Autowired
     private AdminDao adminDao;
 
-    /* (non-Javadoc)
-     * @see de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService#convertToAccessScope(java.util.Collection)
+    /**
+     * Converts a set of scope strings to a set of {@link AccessScope}
+     * 
+     * @param scopes
+     * @return
+     * @throws KustvaktException
      */
-    @Override
     public Set<AccessScope> convertToAccessScope (Collection<String> scopes)
             throws KustvaktException {
 
@@ -64,19 +68,11 @@
         return requestedScopes;
     }
 
-    /* (non-Javadoc)
-     * @see de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService#convertAccessScopesToString(java.util.Set)
-     */
-    @Override
     public String convertAccessScopesToString (Set<AccessScope> scopes) {
         Set<String> set = convertAccessScopesToStringSet(scopes);
         return String.join(" ", set);
     }
 
-    /* (non-Javadoc)
-     * @see de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService#convertAccessScopesToStringSet(java.util.Set)
-     */
-    @Override
     public Set<String> convertAccessScopesToStringSet (
             Set<AccessScope> scopes) {
         Set<String> set = scopes.stream().map(scope -> scope.toString())
@@ -84,10 +80,14 @@
         return set;
     }
 
-    /* (non-Javadoc)
-     * @see de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService#filterScopes(java.util.Set, java.util.Set)
+    /**
+     * Simple reduction of requested scopes, i.e. excluding any scopes
+     * that are not default scopes for a specific authorization grant.
+     * 
+     * @param scopes
+     * @param defaultScopes
+     * @return accepted scopes
      */
-    @Override
     public Set<String> filterScopes (Set<String> scopes,
             Set<String> defaultScopes) {
         Stream<String> stream = scopes.stream();
@@ -115,10 +115,18 @@
         }
     }
 
-    /* (non-Javadoc)
-     * @see de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService#verifyRefreshScope(java.util.Set, java.util.Set)
+    /**
+     * Verify scopes given in a refresh request. The scopes must not
+     * include other scopes than those authorized in the original
+     * access token issued together with the refresh token.
+     * 
+     * @param requestScopes
+     *            requested scopes
+     * @param originalScopes
+     *            authorized scopes
+     * @return a set of requested {@link AccessScope}
+     * @throws KustvaktException
      */
-    @Override
     public Set<AccessScope> verifyRefreshScope (Set<String> requestScopes,
             Set<AccessScope> originalScopes) throws KustvaktException {
         Set<AccessScope> requestedScopes = convertToAccessScope(requestScopes);
diff --git a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
index c18e96f..9647748 100644
--- a/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/oauth2/service/OAuth2TokenService.java
@@ -35,7 +35,7 @@
     private OAuth2AuthorizationService authorizationService;
 
     @Autowired
-    protected OAuth2ScopeService scopeService;
+    protected OAuth2ScopeServiceImpl scopeService;
 
     @Autowired
     protected FullConfiguration config;
diff --git a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
index a9a1fb4..8ed6c09 100644
--- a/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/service/VirtualCorpusService.java
@@ -56,7 +56,7 @@
     private static Logger jlog =
             LogManager.getLogger(VirtualCorpusService.class);
 
-    public static Pattern wordPattern = Pattern.compile("[-\\w ]+");
+    public static Pattern wordPattern = Pattern.compile("[-\\w. ]+");
 
     @Autowired
     private VirtualCorpusDao vcDao;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
index e8047c2..d86a2b1 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2Controller.java
@@ -26,8 +26,8 @@
 
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.oltu.OAuth2AuthorizationRequest;
 import de.ids_mannheim.korap.oauth2.oltu.OAuth2RevokeTokenRequest;
 import de.ids_mannheim.korap.oauth2.oltu.service.OltuAuthorizationService;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2WithOpenIdController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2WithOpenIdController.java
index 761c3f6..6eae61c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2WithOpenIdController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuth2WithOpenIdController.java
@@ -31,8 +31,8 @@
 import com.nimbusds.oauth2.sdk.id.State;
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.openid.OpenIdConfiguration;
 import de.ids_mannheim.korap.oauth2.openid.OpenIdHttpRequestWrapper;
 import de.ids_mannheim.korap.oauth2.openid.service.JWKService;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
index ebcfd51..ca7e168 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/OAuthClientController.java
@@ -18,8 +18,8 @@
 
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientDto;
 import de.ids_mannheim.korap.oauth2.dto.OAuth2ClientInfoDto;
 import de.ids_mannheim.korap.oauth2.service.OAuth2ClientService;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
index 6c9427d..c356d78 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
@@ -21,11 +21,11 @@
 
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.constant.UserGroupStatus;
 import de.ids_mannheim.korap.dto.UserGroupDto;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.service.UserGroupService;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
index 553bfb3..12ce7bf 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/controller/VirtualCorpusController.java
@@ -21,12 +21,12 @@
 
 import com.sun.jersey.spi.container.ResourceFilters;
 
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.constant.VirtualCorpusAccessStatus;
 import de.ids_mannheim.korap.constant.VirtualCorpusType;
 import de.ids_mannheim.korap.dto.VirtualCorpusAccessDto;
 import de.ids_mannheim.korap.dto.VirtualCorpusDto;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.oauth2.service.OAuth2ScopeService;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.service.VirtualCorpusService;
diff --git a/full/src/main/resources/META-INF/persistence.xml b/full/src/main/resources/META-INF/persistence.xml
deleted file mode 100644
index 35b8d66..0000000
--- a/full/src/main/resources/META-INF/persistence.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
-	version="1.0">
-	<persistence-unit name="entityManagerUnit"
-		transaction-type="RESOURCE_LOCAL">
-		<exclude-unlisted-classes />
-	</persistence-unit>
-	<persistence-unit-metadata>
-		<xml-mapping-metadata-complete />
-	</persistence-unit-metadata>
-</persistence>
\ No newline at end of file
diff --git a/full/src/main/resources/kustvakt-lite.conf b/full/src/main/resources/kustvakt-lite.conf
deleted file mode 100644
index f0dd6b3..0000000
--- a/full/src/main/resources/kustvakt-lite.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-# index dir
-krill.indexDir= ../sample-index
-
-krill.index.commit.count = 134217000
-krill.index.commit.log = log/krill.commit.log
-krill.index.commit.auto = 500
-krill.index.relations.max = 100
-
-krill.namedVC=vc
-
-
-# Kustvakt
-
-current.api.version = v1.0
-# multiple versions separated by space
-supported.api.version = v1.0
-
-kustvakt.base.url=/api/*
-kustvakt.default.pos = tt
-kustvakt.default.lemma = tt
-kustvakt.default.token = opennlp
-kustvakt.default.dep = mate
-kustvakt.default.const = mate
-
-# server
-server.port=8089
-server.host=localhost
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
index 0b37968..f976e32 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/AnnotationControllerTest.java
@@ -10,6 +10,7 @@
 import javax.ws.rs.core.MediaType;
 
 import org.junit.Test;
+import org.springframework.test.context.ContextConfiguration;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
@@ -18,6 +19,7 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
+@ContextConfiguration("classpath:test-annotation-config.xml")
 public class AnnotationControllerTest extends SpringJerseyTest {
     @Test
     public void testAnnotationLayers () throws KustvaktException {
@@ -30,10 +32,10 @@
         assertEquals(31, n.size());
         n = n.get(0);
         assertEquals(1, n.get("id").asInt());
-        assertEquals("opennlp/p", n.get("code").asText());
-        assertEquals("p", n.get("layer").asText());
-        assertEquals("opennlp", n.get("foundry").asText());
-        assertNotNull(n.get("description"));
+//        assertEquals("opennlp/p", n.get("code").asText());
+//        assertEquals("p", n.get("layer").asText());
+//        assertEquals("opennlp", n.get("foundry").asText());
+//        assertNotNull(n.get("description"));
     }
 
     @Test
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
index 7fc5807..df9e71d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/FreeResourceControllerTest.java
@@ -3,6 +3,7 @@
 import static org.junit.Assert.assertEquals;
 
 import org.junit.Test;
+import org.springframework.test.context.ContextConfiguration;
 
 import com.fasterxml.jackson.databind.JsonNode;
 import com.sun.jersey.api.client.ClientResponse;
@@ -11,6 +12,7 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
+@ContextConfiguration("classpath:test-annotation-config.xml")
 public class FreeResourceControllerTest extends SpringJerseyTest {
     
     @Test
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
index 84adbf1..07d5e5d 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
+++ b/full/src/test/java/de/ids_mannheim/korap/web/controller/OAuth2AccessTokenTest.java
@@ -20,10 +20,10 @@
 
 import de.ids_mannheim.korap.authentication.http.HttpAuthorizationHandler;
 import de.ids_mannheim.korap.config.Attributes;
+import de.ids_mannheim.korap.constant.OAuth2Scope;
 import de.ids_mannheim.korap.constant.TokenType;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.oauth2.constant.OAuth2Scope;
 import de.ids_mannheim.korap.utils.JsonUtils;
 
 public class OAuth2AccessTokenTest extends OAuth2TestBase {
diff --git a/full/src/test/resources/test-annotation-config.xml b/full/src/test/resources/test-annotation-config.xml
new file mode 100644
index 0000000..957a45c
--- /dev/null
+++ b/full/src/test/resources/test-annotation-config.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xmlns:p="http://www.springframework.org/schema/p" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
+	xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context"
+	xmlns:cache="http://www.springframework.org/schema/cache"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx.xsd
+           http://www.springframework.org/schema/aop
+           http://www.springframework.org/schema/aop/spring-aop.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context.xsd
+           http://www.springframework.org/schema/util
+           http://www.springframework.org/schema/util/spring-util.xsd">
+
+	<import resource="classpath:test-config.xml"/>
+	<bean id="initializator" class="de.ids_mannheim.de.init.InitializatorImpl"
+		init-method="initAnnotationTest">
+	</bean>
+
+</beans>
\ No newline at end of file
diff --git a/lite/Changes b/lite/Changes
index 97abbec..31a61a9 100644
--- a/lite/Changes
+++ b/lite/Changes
@@ -1,3 +1,6 @@
+version 0.61.2
+   - Integrated lite and full services and controllers in core (margaretha)
+
 version 0.61.1
 22/10/2018
    - Updated spring and kustvakt-core versions (margaretha)
@@ -6,7 +9,7 @@
 07/11/2018
     - OpenJDK8u181-workaround (see Debian Bug report #911925; diewald)
 13/11/2018
-    - Added shutdown handler (margaretha)    
+    - Added shutdown handler (margaretha)
 
 version 0.61.0
 30/08/2018
diff --git a/lite/liteDB.sqlite b/lite/liteDB.sqlite
new file mode 100644
index 0000000..4342bb3
--- /dev/null
+++ b/lite/liteDB.sqlite
Binary files differ
diff --git a/lite/pom.xml b/lite/pom.xml
index 9394b19..6b9ae4f 100644
--- a/lite/pom.xml
+++ b/lite/pom.xml
@@ -3,7 +3,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>de.ids_mannheim.korap</groupId>
 	<artifactId>Kustvakt-lite</artifactId>
-	<version>0.61.1</version>
+	<version>0.61.2</version>
 	<properties>
 		<java.version>1.8</java.version>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -15,15 +15,6 @@
 		<resources>
 			<resource>
 				<directory>src/main/resources</directory>
-				<filtering>true</filtering>
-				<includes>
-					<include>**/*.info</include>
-					<include>**/*.xml</include>
-					<include>**/*.conf</include>
-					<include>**/*.kustvakt</include>
-					<include>**/*.properties</include>
-					<include>**/*.sql</include>
-				</includes>
 			</resource>
 		</resources>
 		<testResources>
@@ -148,17 +139,8 @@
 		<dependency>
 			<groupId>de.ids_mannheim.korap</groupId>
 			<artifactId>Kustvakt-core</artifactId>
-			<version>0.61.3</version>
+			<version>[0.61.3,)</version>
 		</dependency>
-		
-		<!-- Spring -->
-		<dependency>
-			<groupId>org.springframework</groupId>
-			<artifactId>spring-test</artifactId>
-			<version>${spring-framework.version}</version>
-			<scope>compile</scope>
-		</dependency>
-		
 		<!-- Jersey test framework -->
 		<dependency>
 			<groupId>com.sun.jersey.jersey-test-framework</groupId>
diff --git a/full/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java b/lite/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java
similarity index 94%
rename from full/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java
rename to lite/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java
index 31d90af..b9229cd 100644
--- a/full/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java
+++ b/lite/src/main/java/de/ids_mannheim/de/init/LiteInitializatorImpl.java
@@ -20,7 +20,7 @@
 
     @Override
     public void initTest () throws IOException, KustvaktException {
-        annotationParser.run();
+//        annotationParser.run();
     }
 
 }
diff --git a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java b/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
similarity index 98%
rename from full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
rename to lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
index 0a473ac..22f1d12 100644
--- a/full/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
+++ b/lite/src/main/java/de/ids_mannheim/korap/authentication/DummyAuthenticationManager.java
@@ -20,6 +20,8 @@
     @Autowired
     private KustvaktConfiguration config;
 
+    public DummyAuthenticationManager () {}
+    
     @Override
     public TokenContext getTokenContext (TokenType type, String token,
             String host, String useragent) throws KustvaktException {
diff --git a/full/src/main/java/de/ids_mannheim/korap/dao/DummyAdminDaoImpl.java b/lite/src/main/java/de/ids_mannheim/korap/dao/DummyAdminDaoImpl.java
similarity index 100%
rename from full/src/main/java/de/ids_mannheim/korap/dao/DummyAdminDaoImpl.java
rename to lite/src/main/java/de/ids_mannheim/korap/dao/DummyAdminDaoImpl.java
diff --git a/lite/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java b/lite/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
new file mode 100644
index 0000000..891dc12
--- /dev/null
+++ b/lite/src/main/java/de/ids_mannheim/korap/oauth2/service/DummyOAuth2ScopeServiceImpl.java
@@ -0,0 +1,15 @@
+package de.ids_mannheim.korap.oauth2.service;
+
+import de.ids_mannheim.korap.constant.OAuth2Scope;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.security.context.TokenContext;
+
+public class DummyOAuth2ScopeServiceImpl implements OAuth2ScopeService {
+
+      @Override
+    public void verifyScope (TokenContext context, OAuth2Scope requiredScope)
+            throws KustvaktException {
+        // TODO Auto-generated method stub
+
+    }
+}
diff --git a/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
deleted file mode 100644
index 3786b11..0000000
--- a/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package de.ids_mannheim.korap.server;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.security.SecureRandom;
-import java.util.UUID;
-
-import javax.servlet.ServletContextListener;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.lang.ArrayUtils;
-import org.eclipse.jetty.server.Connector;
-import org.eclipse.jetty.server.Server;
-import org.eclipse.jetty.server.ServerConnector;
-import org.eclipse.jetty.server.handler.HandlerList;
-import org.eclipse.jetty.server.handler.ShutdownHandler;
-import org.eclipse.jetty.servlet.ServletContextHandler;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.springframework.web.context.ContextLoaderListener;
-
-import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
-
-import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import lombok.Getter;
-import lombok.Setter;
-
-/**
- * @author hanl
- * @date 01/06/2015
- */
-public abstract class KustvaktBaseServer {
-
-    protected static KustvaktConfiguration config;
-
-    protected static String rootPackages;
-    protected static KustvaktArgs kargs;
-
-    public KustvaktBaseServer () {}
-
-    protected KustvaktArgs readAttributes (String[] args) {
-        KustvaktArgs kargs = new KustvaktArgs();
-        for (int i = 0; i < args.length; i++) {
-            switch ((args[i])) {
-                case "--spring-config":
-                    kargs.setSpringConfig(args[i + 1]);
-                    break;
-                case "--port":
-                    kargs.setPort(Integer.valueOf(args[i + 1]));
-                    break;
-                case "--help":
-                    StringBuffer b = new StringBuffer();
-
-                    b.append("Parameter description: \n")
-                            .append("--spring-config  <Spring XML configuration filename in classpath>\n")
-                            .append("--port  <Server port number>\n")
-                            .append("--help : This help menu\n");
-                    System.out.println(b.toString());
-                    System.out.println();
-                    return (KustvaktArgs) null;
-            }
-        }
-        return kargs;
-    }
-
-    protected void start ()
-            throws KustvaktException, IOException, NoSuchAlgorithmException {
-
-        if (kargs.port == -1) {
-            kargs.setPort(config.getPort());
-        }
-
-        Server server = new Server();
-
-        ServletContextHandler contextHandler =
-                new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
-        contextHandler.setContextPath("/");
-        contextHandler.setInitParameter("contextConfigLocation",
-                "classpath:" + kargs.getSpringConfig());
-
-        ServletContextListener listener = new ContextLoaderListener();
-        contextHandler.addEventListener(listener);
-
-        ServletHolder servletHolder = new ServletHolder(new SpringServlet());
-        servletHolder.setInitParameter(
-                "com.sun.jersey.config.property.packages", rootPackages);
-        servletHolder.setInitParameter(
-                "com.sun.jersey.api.json.POJOMappingFeature", "true");
-        servletHolder.setInitOrder(1);
-        contextHandler.addServlet(servletHolder, config.getBaseURL());
-
-        ServerConnector connector = new ServerConnector(server);
-        connector.setPort(kargs.port);
-        connector.setIdleTimeout(60000);
-
-        String shutdownToken = createRandomCode();
-        ShutdownHandler shutdownHandler =
-                new ShutdownHandler(shutdownToken, true, true);
-
-        FileOutputStream fos = new FileOutputStream(new File("shutdownToken"));
-        OutputStreamWriter writer =
-                new OutputStreamWriter(fos, StandardCharsets.UTF_8.name());
-        writer.write(shutdownToken);
-        writer.flush();
-        writer.close();
-
-        HandlerList handlers = new HandlerList();
-        handlers.addHandler(shutdownHandler);
-        handlers.addHandler(contextHandler);
-
-        server.setHandler(handlers);
-
-        server.setConnectors(new Connector[] { connector });
-        try {
-            server.start();
-            server.join();
-        }
-        catch (Exception e) {
-            System.out.println("Server could not be started!");
-            System.out.println(e.getMessage());
-            e.printStackTrace();
-            System.exit(-1);
-        }
-    }
-
-    @Setter
-    public static class KustvaktArgs {
-
-        @Getter
-        private String springConfig;
-        private int port;
-
-        public KustvaktArgs () {
-            this.port = -1;
-            this.springConfig = null;
-        }
-    }
-
-    public String createRandomCode () throws NoSuchAlgorithmException {
-        UUID randomUUID = UUID.randomUUID();
-        byte[] uuidBytes = randomUUID.toString().getBytes();
-        byte[] secureBytes = new byte[3];
-        SecureRandom secureRandom = SecureRandom.getInstance("SHA1PRNG");
-        secureRandom.nextBytes(secureBytes);
-
-        byte[] bytes = ArrayUtils.addAll(uuidBytes, secureBytes);
-
-        MessageDigest md = MessageDigest.getInstance("MD5");
-        md.update(bytes);
-        byte[] digest = md.digest();
-        String code = Base64.encodeBase64URLSafeString(digest);
-        md.reset();
-        return code;
-    }
-}
diff --git a/lite/src/main/java/de/ids_mannheim/korap/web/service/lite/LiteService.java b/lite/src/main/java/de/ids_mannheim/korap/web/service/lite/LiteService.java
deleted file mode 100644
index 3873773..0000000
--- a/lite/src/main/java/de/ids_mannheim/korap/web/service/lite/LiteService.java
+++ /dev/null
@@ -1,416 +0,0 @@
-package de.ids_mannheim.korap.web.service.lite;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.annotation.PostConstruct;
-import javax.servlet.http.HttpServletRequest;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.UriBuilder;
-
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import com.sun.jersey.spi.container.ResourceFilters;
-
-import de.ids_mannheim.korap.config.KustvaktConfiguration;
-import de.ids_mannheim.korap.config.QueryBuilderUtil;
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.exceptions.StatusCodes;
-import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
-import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.resource.rewrite.RewriteHandler;
-import de.ids_mannheim.korap.utils.KoralCollectionQueryBuilder;
-import de.ids_mannheim.korap.web.APIVersionFilter;
-import de.ids_mannheim.korap.web.ClientsHandler;
-import de.ids_mannheim.korap.web.CoreResponseHandler;
-import de.ids_mannheim.korap.web.SearchKrill;
-
-/**
- * @author hanl
- * @date 29/01/2014
- * 
- * @author margaretha
- * @update 28/08/2018
- * 
- * <pre>
- * Recent changes:
- * - removed version from service paths
- * - altered service with path /search and method trace to path
- * /query and method get
- * - added API URL versioning
- * </pre>
- */
-@Controller
-@Path("{version}/")
-@ResourceFilters(APIVersionFilter.class)
-@Produces(MediaType.APPLICATION_JSON + ";charset=utf-8")
-public class LiteService {
-
-    private static Logger jlog = LogManager.getLogger(LiteService.class);
-
-    @Autowired
-    private CoreResponseHandler kustvaktResponseHandler;
-    @Autowired
-    private SearchKrill searchKrill;
-    private ClientsHandler graphDBhandler;
-    @Autowired
-    private RewriteHandler processor;
-    @Autowired
-    private KustvaktConfiguration config;
-
-
-    public LiteService () {
-        // Karang URI
-        UriBuilder builder = UriBuilder.fromUri("http://10.0.10.13").port(9997);
-        this.graphDBhandler = new ClientsHandler(builder.build());
-    }
-
-    @PostConstruct
-    private void init () {
-        processor.defaultRewriteConstraints();
-    }
-    
-    /** Requires Karang (Neo4j search engine)
-     *  
-     * @param query
-     * @return response
-     */
-    @POST
-    @Path("colloc")
-    public Response getCollocationBase (@QueryParam("q") String query) {
-        String result;
-        try {
-            result = graphDBhandler.getResponse("distCollo", "q", query);
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(result).build();
-    }
-
-
-    // todo
-    @Deprecated
-    public Response postMatchFavorite () {
-        return Response.ok().build();
-    }
-
-
-    @SuppressWarnings("unchecked")
-    @GET
-    @Path("query")
-    public Response buildQuery (@QueryParam("q") String q,
-            @QueryParam("ql") String ql, @QueryParam("v") String v,
-            @QueryParam("context") String context,
-            @QueryParam("cutoff") Boolean cutoff,
-            @QueryParam("count") Integer pageLength,
-            @QueryParam("offset") Integer pageIndex,
-            @QueryParam("page") Integer startPage,
-            @QueryParam("cq") String cq) {
-        QuerySerializer ss = new QuerySerializer().setQuery(q, ql, v);
-
-        MetaQueryBuilder meta = new MetaQueryBuilder();
-        meta.addEntry("startIndex", pageIndex);
-        if (pageIndex == null && startPage != null)
-            meta.addEntry("startPage", startPage);
-        meta.addEntry("count", pageLength);
-        meta.setSpanContext(context);
-        meta.addEntry("cutOff", cutoff);
-        ss.setMeta(meta.raw());
-        if (cq != null) ss.setCollection(cq);
-
-        String query;
-        try {
-            query = this.processor.processQuery(ss.toJSON(), null);
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-        return Response.ok(query).build();
-    }
-
-
-    @POST
-    @Path("search")
-    public Response queryRaw (@QueryParam("engine") String engine,
-            String jsonld) {
-        try {
-            jsonld = processor.processQuery(jsonld, null);
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-
-		// todo: should be possible to add the meta part to the query serialization
-		jlog.info("Serialized search: "+jsonld);
-		try {
-			String result = searchKrill.search(jsonld);
-			jlog.debug("The result set: "+result);
-			return Response.ok(result).build();
-		}
-		catch (Exception e) {
-			e.printStackTrace();
-		};
-		return Response.ok().build();
-    }
-
-
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    @GET
-    @Path("search")
-    public Response searchbyNameAll (@QueryParam("q") String q,
-            @QueryParam("ql") String ql, @QueryParam("v") String v,
-            @QueryParam("context") String ctx,
-            @QueryParam("cutoff") Boolean cutoff,
-            @QueryParam("count") Integer pageLength,
-            @QueryParam("offset") Integer pageIndex,
-            @QueryParam("page") Integer pageInteger,
-            @QueryParam("fields") Set<String> fields,
-            // fixme: remove cq value from lightservice
-            @QueryParam("cq") String cq, @QueryParam("engine") String engine) {
-        KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
-
-        String result;
-        QuerySerializer serializer = new QuerySerializer().setQuery(q, ql, v);
-        MetaQueryBuilder meta = QueryBuilderUtil.defaultMetaBuilder(pageIndex,
-                pageInteger, pageLength, ctx, cutoff);
-        if (fields != null && !fields.isEmpty())
-            meta.addEntry("fields", fields);
-        serializer.setMeta(meta.raw());
-        if (cq != null) serializer.setCollection(cq);
-
-
-		// There is an error in query processing
-		// - either query, corpus or meta
-		if (serializer.hasErrors()) {
-			// Do not pass further to backend
-			return Response.status(Response.Status.BAD_REQUEST).entity(serializer.toJSON()).build();		
-		}
-
-		
-        String query;
-        try {
-            query = this.processor.processQuery(serializer.toJSON(), null);
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
-
-		jlog.info("the serialized query "+ query);
-
-        // This may not work with the the KoralQuery
-        if (eng.equals(KustvaktConfiguration.BACKENDS.NEO4J)) {
-            MultivaluedMap map = new MultivaluedMapImpl();
-            map.add("q", query);
-            map.add("count", String.valueOf(pageLength));
-            map.add("lctxs",
-                    String.valueOf(meta.getSpanContext().getLeftSize()));
-            map.add("rctxs",
-                    String.valueOf(meta.getSpanContext().getRightSize()));
-
-            try {
-                result = this.graphDBhandler.getResponse(map, "distKwic");
-            }
-            catch (KustvaktException e) {
-                throw kustvaktResponseHandler.throwit(e);
-            }
-        }
-        else
-            result = searchKrill.search(query);
-        jlog.debug("The result set: "+ result);
-        return Response.ok(result).build();
-    }
-
-
-    /**
-     * param context will be like this: context: "3-t,2-c"
-     * <p/>
-     * id does not have to be an integer. name is also possible, in
-     * which case a type reference is required
-     * 
-     * @param query
-     * @param ql
-     * @param v
-     * @param ctx
-     * @param cutoff
-     * @param pageLength
-     * @param pageIndex
-     * @param pageInteger
-     * @param id
-     * @param type
-     * @param cq
-     * @param raw
-     * @param engine
-     * @return
-     */
-    @SuppressWarnings({ "unchecked", "rawtypes" })
-    //fixme: search in collection /collection/collection-id/search
-    @Deprecated
-    @GET
-    //    @Path("/{type}/{id}/search")
-    public Response searchbyName (@PathParam("id") String id,
-            @PathParam("type") String type, @QueryParam("q") String query,
-            @QueryParam("ql") String ql, @QueryParam("v") String v,
-            @QueryParam("context") String ctx,
-            @QueryParam("cutoff") Boolean cutoff,
-            @QueryParam("count") Integer pageLength,
-            @QueryParam("offset") Integer pageIndex,
-            @QueryParam("page") Integer pageInteger,
-            @QueryParam("cq") String cq, @QueryParam("raw") Boolean raw,
-            @QueryParam("engine") String engine) {
-        // ref is a virtual collection id!
-        KustvaktConfiguration.BACKENDS eng = this.config.chooseBackend(engine);
-        raw = raw == null ? false : raw;
-        MetaQueryBuilder meta = QueryBuilderUtil.defaultMetaBuilder(pageIndex,
-                pageInteger, pageLength, ctx, cutoff);
-        if (!raw) {
-            // should only apply to CQL queries
-            //                meta.addEntry("itemsPerResource", 1);
-            QuerySerializer s = new QuerySerializer().setQuery(query, ql, v)
-                    .setMeta(meta.raw());
-            try {
-                query = this.processor.processQuery(s.toJSON(), null);
-            }
-            catch (KustvaktException e) {
-                throw kustvaktResponseHandler.throwit(e);
-            }
-        }
-        String result;
-        try {
-            if (eng.equals(KustvaktConfiguration.BACKENDS.NEO4J)) {
-                if (raw) throw kustvaktResponseHandler.throwit(
-                        StatusCodes.ILLEGAL_ARGUMENT, "raw not supported!",
-                        null);
-                MultivaluedMap map = new MultivaluedMapImpl();
-                map.add("q", query);
-                map.add("count", String.valueOf(pageLength));
-                map.add("lctxs",
-                        String.valueOf(meta.getSpanContext().getLeftSize()));
-                map.add("rctxs",
-                        String.valueOf(meta.getSpanContext().getRightSize()));
-                result = this.graphDBhandler.getResponse(map, "distKwic");
-            }
-            else
-                result = searchKrill.search(query);
-
-        }
-        catch (Exception e) {
-            jlog.error("Exception for serialized query: " + query, e);
-            throw kustvaktResponseHandler.throwit(500, e.getMessage(), null);
-        }
-
-        jlog.debug("The result set: "+ result);
-        return Response.ok(result).build();
-    }
-
-
-    @GET
-    @Path("statistics")
-    public Response getStatistics (
-            @QueryParam("corpusQuery") String collectionQuery) {
-
-        KoralCollectionQueryBuilder builder = new KoralCollectionQueryBuilder();
-
-		String stats;
-		if (collectionQuery != null && !collectionQuery.equals("")) {
-			builder.with(collectionQuery);
-			String json;
-			try {
-				json = builder.toJSON();
-			}
-			catch (KustvaktException e) {
-				throw kustvaktResponseHandler.throwit(e);
-			}
-			stats = searchKrill.getStatistics(json);
-		}
-		else {
-			stats = searchKrill.getStatistics(null);
-		};
-
-        if (stats.contains("-1"))
-            throw kustvaktResponseHandler.throwit(StatusCodes.NO_RESULT_FOUND);
-        jlog.debug("Stats: " + stats);
-        return Response.ok(stats).build();
-    }
-
-
-
-    /*
-     * TODO: The problem here is, that the matchinfo path makes no
-     * distinction between docs and texts - unlike DeReKo, the backend
-     * and the frontend. Luckily there is a convenient method
-     * "getMatchID()" for a workaround, but this should be fixed.
-     */
-    @GET
-    @Path("/corpus/{corpusId}/{docId}/{textId}/{matchId}/matchInfo")
-    public Response getMatchInfo (@PathParam("corpusId") String corpusId,
-            @PathParam("docId") String docId,
-            @PathParam("textId") String textId,
-            @PathParam("matchId") String matchId,
-            @QueryParam("foundry") Set<String> foundries,
-            @QueryParam("layer") Set<String> layers,
-            @QueryParam("spans") Boolean spans,
-			// Highlights may also be a list of valid highlight classes
-			@QueryParam("hls") Boolean highlights,
-            @Context HttpServletRequest request) throws KustvaktException {
-
-        String matchid =
-                searchKrill.getMatchId(corpusId, docId, textId, matchId);
-        
-        List<String> f_list = null;
-        List<String> l_list = null;
-        if (layers != null && !layers.isEmpty())
-            l_list = new ArrayList<>(layers);
-
-        if (foundries != null && !foundries.isEmpty()
-                && !foundries.contains("*"))
-            f_list = new ArrayList<>(foundries);
-
-        spans = spans != null ? spans : false;
-        highlights = highlights != null ? highlights : false;
-
-        boolean match_only = foundries == null || foundries.isEmpty();
-        String results;
-        if (match_only)
-            results = searchKrill.getMatch(matchid, null);
-        else
-            results = searchKrill.getMatch(matchid, f_list, l_list, spans,
-                    highlights, true, null);
-
-        return Response.ok(results).build();
-    }
-
-
-	/*
-     * Returns the meta data fields of a certain document
-     */
-    @GET
-    @Path("/corpus/{corpusId}/{docId}/{textId}")
-    public Response getMeta (
-		@PathParam("corpusId") String corpusId,
-		@PathParam("docId") String docId,
-		@PathParam("textId") String textId,
-		// @QueryParam("fields") Set<String> fields,
-		@Context HttpServletRequest request) throws KustvaktException {
-
-		String textSigle = searchKrill.getTextSigle(corpusId, docId, textId);
-		
-		String results = searchKrill.getFields(textSigle);
-
-        return Response.ok(results).build();
-    }
-}
diff --git a/full/src/main/resources/db/lite-sqlite/V1__annotation_tables.sql b/lite/src/main/resources/db/V1__annotation_tables.sql
similarity index 100%
rename from full/src/main/resources/db/lite-sqlite/V1__annotation_tables.sql
rename to lite/src/main/resources/db/V1__annotation_tables.sql
diff --git a/lite/src/main/resources/hibernate.properties b/lite/src/main/resources/hibernate.properties
new file mode 100644
index 0000000..199dc73
--- /dev/null
+++ b/lite/src/main/resources/hibernate.properties
@@ -0,0 +1,8 @@
+hibernate.dialect=org.hibernate.dialect.MySQLDialect
+hibernate.hbm2ddl.auto=none
+hibernate.show_sql=false
+hibernate.cache.use_query_cache=false
+hibernate.cache.use_second_level_cache=false
+hibernate.cache.provider=org.hibernate.cache.EhCacheProvider
+hibernate.cache.region.factory=org.hibernate.cache.ehcache.EhCacheRegionFactory
+hibernate.jdbc.time_zone=UTC
\ No newline at end of file
diff --git a/lite/src/main/resources/kustvakt-lite.conf b/lite/src/main/resources/kustvakt-lite.conf
index f0dd6b3..db385f0 100644
--- a/lite/src/main/resources/kustvakt-lite.conf
+++ b/lite/src/main/resources/kustvakt-lite.conf
@@ -8,7 +8,6 @@
 
 krill.namedVC=vc
 
-
 # Kustvakt
 
 current.api.version = v1.0
diff --git a/lite/src/main/resources/kustvakt.info b/lite/src/main/resources/kustvakt.info
new file mode 100644
index 0000000..ea847bb
--- /dev/null
+++ b/lite/src/main/resources/kustvakt.info
@@ -0,0 +1,8 @@
+kustvakt.version=${project.version}
+kustvakt.name=${project.name}
+
+# use this file to define the properties and logging file names
+kustvakt.properties=./kustvakt-lite.conf
+kustvakt.logging=./log4j.properties
+kustvakt.cache=true
+kustvakt.cache_store=./store
\ No newline at end of file
diff --git a/lite/src/main/resources/lite-config.xml b/lite/src/main/resources/lite-config.xml
index 671ca33..7c5991c 100644
--- a/lite/src/main/resources/lite-config.xml
+++ b/lite/src/main/resources/lite-config.xml
@@ -1,57 +1,181 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xmlns:util="http://www.springframework.org/schema/util"
-       xmlns:context="http://www.springframework.org/schema/context"
-       xmlns="http://www.springframework.org/schema/beans"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx.xsd
            http://www.springframework.org/schema/context
            http://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/util
            http://www.springframework.org/schema/util/spring-util.xsd">
 
 
-    <context:component-scan base-package="de.ids_mannheim.korap" />
+	<context:component-scan
+		base-package="de.ids_mannheim.korap.web.filter, de.ids_mannheim.korap.web.utils,
+		de.ids_mannheim.korap.authentication.http" />
 	<context:annotation-config />
 
-    <bean id="properties"
-          class="org.springframework.beans.factory.config.PropertiesFactoryBean">
-        <property name="ignoreResourceNotFound" value="true"/>
-        <property name="locations">
-            <array>
-                <value>classpath:kustvakt-lite.conf</value>
-                <value>file:./kustvakt-lite.conf</value>
-            </array>
-        </property>
-    </bean>
-    
-    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
-		<property name="properties">
-			<ref bean="properties"/>
+	<bean id="placeholders"
+		class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:lite-jdbc.properties</value>
+				<value>file:./lite-jdbc.properties</value>
+				<value>classpath:hibernate.properties</value>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
 		</property>
 	</bean>
 
-    <bean id="kustvakt_auditing"
-          class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
-    </bean>
-    
-    <bean id="kustvakt_response"
-          class="de.ids_mannheim.korap.web.CoreResponseHandler">
-          <constructor-arg index="0" name="iface" ref="kustvakt_auditing"/>
-    </bean>
-
-    <bean id="kustvakt_config"
-          class="de.ids_mannheim.korap.config.KustvaktConfiguration">
-        <constructor-arg index="0" name="properties" ref="properties"/>
-    </bean>
-
-    <bean id="kustvakt_rewrite" class="de.ids_mannheim.korap.resource.rewrite.RewriteHandler">
-		<constructor-arg ref="kustvakt_config" />
+	<bean id="properties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
+		</property>
 	</bean>
-    
-    <bean id="search_krill"
-          class="de.ids_mannheim.korap.web.SearchKrill">
-        <constructor-arg value="${krill.indexDir}"/>
-    </bean>
-    
+
+	<bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
+		<constructor-arg index="0" name="properties" ref="properties" />
+	</bean>
+
+	<!-- Database -->
+
+	<bean id="sqliteDataSource"
+		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
+		lazy-init="true">
+		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		<property name="connectionProperties">
+			<props>
+				<prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
+			</props>
+		</property>
+
+		<!-- relevant for single connection datasource and sqlite -->
+		<property name="suppressClose">
+			<value>true</value>
+		</property>
+		<!--<property name="initialSize" value="2"/> -->
+		<!--<property name="poolPreparedStatements" value="true"/> -->
+	</bean>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+		<property name="baselineOnMigrate" value="true" />
+		<!-- <property name="validateOnMigrate" value="false" /> -->
+		<!-- <property name="cleanOnValidationError" value="true" /> -->
+		<property name="locations" value="${jdbc.schemaPath}" />
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<bean id="entityManagerFactory"
+		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+		<property name="dataSource" ref="sqliteDataSource" />
+
+		<property name="packagesToScan">
+			<array>
+				<value>de.ids_mannheim.korap.entity</value>
+			</array>
+		</property>
+		<property name="jpaVendorAdapter">
+			<bean id="jpaVendorAdapter"
+				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+				<property name="databasePlatform" value="${hibernate.dialect}" />
+			</bean>
+		</property>
+		<property name="jpaProperties">
+			<props>
+				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
+				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
+				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
+				<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
+				<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
+				</prop>
+				<prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
+				<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
+				<prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
+			</props>
+		</property>
+	</bean>
+	<tx:annotation-driven proxy-target-class="true"
+		transaction-manager="transactionManager" />
+
+	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<constructor-arg ref="transactionManager" />
+	</bean>
+	<bean id="txManager"
+		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<!-- Initialization -->
+	<bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
+		init-method="init">
+	</bean>
+	<bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
+		scope="singleton" />
+
+	<!-- Krill -->
+	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+		<constructor-arg value="${krill.indexDir}" />
+	</bean>
+
+	<!-- Filters -->
+	<bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
+		scope="singleton" />
+
+	<!-- Authentication -->
+	<bean id="authenticationManager"
+		class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
+
+	<!-- Response handler -->
+	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+		<constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
+	</bean>
+
+	<!-- Controllers -->
+	<bean id="annotationController"
+		class="de.ids_mannheim.korap.web.controller.AnnotationController" />
+	<bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
+	<bean id="statisticController"
+		class="de.ids_mannheim.korap.web.controller.StatisticController" />
+
+	<!-- Services -->
+	<bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
+	<bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
+
+	<!-- DAO -->
+	<bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
+	<bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
+
+	<!-- DTO Converter -->
+	<bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
+
+	<!-- Rewrite -->
+	<bean id="rewriteHandler" class="de.ids_mannheim.korap.resource.rewrite.RewriteHandler">
+		<constructor-arg ref="config" />
+	</bean>
+
+
+
+	<bean id="kustvakt_auditing"
+		class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
+	</bean>
+
 </beans>
\ No newline at end of file
diff --git a/full/src/main/resources/properties/lite-jdbc.properties b/lite/src/main/resources/lite-jdbc.properties
similarity index 87%
rename from full/src/main/resources/properties/lite-jdbc.properties
rename to lite/src/main/resources/lite-jdbc.properties
index 5aa9ca8..99e2e54 100644
--- a/full/src/main/resources/properties/lite-jdbc.properties
+++ b/lite/src/main/resources/lite-jdbc.properties
@@ -6,4 +6,4 @@
 jdbc.url=jdbc:sqlite:liteDB.sqlite
 jdbc.username=pc
 jdbc.password=pc
-jdbc.schemaPath=db.lite-sqlite
\ No newline at end of file
+jdbc.schemaPath=db
\ No newline at end of file
diff --git a/lite/src/main/resources/log4j2.properties b/lite/src/main/resources/log4j2.properties
index f5e5366..b0115e7 100644
--- a/lite/src/main/resources/log4j2.properties
+++ b/lite/src/main/resources/log4j2.properties
@@ -20,8 +20,8 @@
 logger.console.appenderRefs = stdout
 logger.console.appenderRef.file.ref = STDOUT
 
-#loggers=file
-#logger.file.name=de.ids_mannheim.korap
-#logger.file.level = error
-#logger.file.appenderRefs = file
-#logger.file.appenderRef.file.ref = ERRORLOG
\ No newline at end of file
+loggers=file
+logger.file.name=de.ids_mannheim.korap
+logger.file.level = error
+logger.file.appenderRefs = file
+logger.file.appenderRef.file.ref = ERRORLOG
\ No newline at end of file
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteJerseyTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteJerseyTest.java
similarity index 94%
rename from full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteJerseyTest.java
rename to lite/src/test/java/de/ids_mannheim/korap/web/service/LiteJerseyTest.java
index 1846495..a0ea0a3 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteJerseyTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteJerseyTest.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.web.lite.controller;
+package de.ids_mannheim.korap.web.service;
 
 import java.io.IOException;
 import java.net.ServerSocket;
@@ -33,7 +33,7 @@
                 .servletClass(SpringServlet.class)
                 .contextListenerClass(ContextLoaderListener.class)
                 .contextParam("contextConfigLocation",
-                        "classpath:lite-config.xml")
+                        "classpath:test-config.xml")
                 .build();
     }
 
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteSearchControllerTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
similarity index 99%
rename from full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteSearchControllerTest.java
rename to lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
index 9e1d779..68088fc 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteSearchControllerTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteSearchControllerTest.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.web.lite.controller;
+package de.ids_mannheim.korap.web.service;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteServiceTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteServiceTest.java
deleted file mode 100644
index 3578b21..0000000
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteServiceTest.java
+++ /dev/null
@@ -1,453 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.net.URI;
-import java.util.Iterator;
-import java.util.concurrent.ThreadLocalRandom;
-
-import javax.ws.rs.core.MediaType;
-
-import org.eclipse.jetty.http.HttpStatus;
-import org.junit.Test;
-import org.springframework.web.context.ContextLoaderListener;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
-import com.sun.jersey.test.framework.AppDescriptor;
-import com.sun.jersey.test.framework.JerseyTest;
-import com.sun.jersey.test.framework.WebAppDescriptor;
-import com.sun.jersey.test.framework.spi.container.TestContainerException;
-import com.sun.jersey.test.framework.spi.container.TestContainerFactory;
-import com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.query.serialize.QuerySerializer;
-import de.ids_mannheim.korap.utils.JsonUtils;
-
-/**
- * Created by hanl on 29.04.16.
- * 
- * @author margaretha, diewald
- * @date 08/03/2018
- * 
- * Recent changes:
- * - removed test configuration using FastJerseyLightTest
- * - added metadata test
- * - updated field type:date 
- */
-public class LiteServiceTest extends JerseyTest{
-
-    public static final String API_VERSION = "v1.0";
-    public static final String classPackage = "de.ids_mannheim.korap.web.service.lite";
-
-    @Override
-    protected TestContainerFactory getTestContainerFactory ()
-            throws TestContainerException {
-        return new GrizzlyWebTestContainerFactory();
-    }
-
-    @Override
-    protected AppDescriptor configure () {
-        return new WebAppDescriptor.Builder(classPackage)
-                .servletClass(SpringServlet.class)
-                .contextListenerClass(ContextLoaderListener.class)
-                .contextParam("contextConfigLocation",
-                        "classpath:lite-config.xml")
-                .build();
-    }
-
-    @Override
-    protected int getPort (int defaultPort) {
-        int port = ThreadLocalRandom.current().nextInt(5000, 8000 + 1);
-        try {
-            ServerSocket socket = new ServerSocket(port);
-            socket.close();
-        }
-        catch (IOException e) {
-            e.printStackTrace();
-            port = getPort(port);
-        }
-        return port;
-    }
-    
-    @Test
-    public void testStatistics () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("statistics")
-                .queryParam("corpusQuery", "textType=Autobiographie & corpusSigle=GOE")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertEquals(9, node.at("/documents").asInt());
-        assertEquals(527662, node.at("/tokens").asInt());
-        assertEquals(19387, node.at("/sentences").asInt());
-        assertEquals(514, node.at("/paragraphs").asInt());
-    }
-
-	@Test
-    public void testEmptyStatistics () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-			.path("statistics")
-			.queryParam("corpusQuery", "")
-			.method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertEquals(11, node.at("/documents").asInt());
-        assertEquals(665842, node.at("/tokens").asInt());
-        assertEquals(25074, node.at("/sentences").asInt());
-        assertEquals(772, node.at("/paragraphs").asInt());
-
-		response = resource().path(API_VERSION)
-                .path("statistics")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-		query = response.getEntity(String.class);
-		node = JsonUtils.readTree(query);
-        assertEquals(11, node.at("/documents").asInt());
-        assertEquals(665842, node.at("/tokens").asInt());
-        assertEquals(25074, node.at("/sentences").asInt());
-        assertEquals(772, node.at("/paragraphs").asInt());
-	}
-
-	
-    @Test
-    public void testGetJSONQuery () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("query").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
-                .queryParam("count", "13")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-//        System.out.println(query);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertEquals("opennlp", node.at("/query/wrap/foundry").asText());
-        assertEquals("sentence", node.at("/meta/context").asText());
-        assertEquals("13", node.at("/meta/count").asText());
-    }
-
-
-    @Test
-    public void testbuildAndPostQuery () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("query").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-
-        response = resource().path(API_VERSION).path("search")
-                .post(ClientResponse.class, query);
-
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String matches = response.getEntity(String.class);
-        JsonNode match_node = JsonUtils.readTree(matches);
-        assertNotEquals(0, match_node.path("matches").size());
-    }
-
-
-    @Test
-    public void testQueryGet () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
-                .queryParam("count", "13").get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertEquals("base/s:s", node.at("/meta/context").asText());
-        assertEquals("13", node.at("/meta/count").asText());
-        assertNotEquals(0, node.at("/matches").size());
-    }
-
-	@Test
-    public void testQueryFailure () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[orth=das")
-                .queryParam("ql", "poliqarp")
-                .queryParam("cq", "corpusSigle=WPD | corpusSigle=GOE")
-			.queryParam("count", "13")
-			.get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.BAD_REQUEST.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-
-		JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals(302, node.at("/errors/0/0").asInt());
-        assertEquals(302, node.at("/errors/1/0").asInt());
-		assertTrue(node.at("/errors/2").isMissingNode());
-		assertFalse(node.at("/collection").isMissingNode());
-        assertEquals(13, node.at("/meta/count").asInt());
-    }
-
-
-    @Test
-    public void testFoundryRewrite () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp").queryParam("context", "sentence")
-                .queryParam("count", "13").get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertEquals("opennlp", node.at("/query/wrap/foundry").asText());
-    }
-
-
-    @Test
-    public void testQueryPost () throws KustvaktException{
-        QuerySerializer s = new QuerySerializer();
-        s.setQuery("[orth=das]", "poliqarp");
-
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").post(ClientResponse.class, s.toJSON());
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertNotEquals(0, node.at("/matches").size());
-    }
-
-
-    @Test
-    public void testParameterField () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("search").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("fields", "author, docSigle")
-                .queryParam("context", "sentence").queryParam("count", "13")
-                .get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertNotEquals(0, node.at("/matches").size());
-        assertEquals("[\"author, docSigle\"]", node.at("/meta/fields")
-                .toString());
-    }
-
-	@Test
-	public void testMatchInfoGetWithoutSpans () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-			.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
-			.queryParam("foundry", "*")
-			.queryParam("spans", "false")
-			.get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-					 response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertEquals("GOE/AGA/01784", node.at("/textSigle").asText());
-        assertEquals("match-GOE/AGA/01784-p36-46(5)37-45(2)38-42",
-					 node.at("/matchID").asText());
-        assertEquals("Belagerung von Mainz", node.at("/title").asText());
-	};
-
-	@Test
-	public void testMatchInfoGetWithoutHighlights () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-			.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
-			.queryParam("foundry", "xy")
-			.queryParam("spans", "false")
-			.get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-					 response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertEquals("<span class=\"context-left\"></span><span class=\"match\">der alte freie Weg nach Mainz war gesperrt, ich mußte über die Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; der Ort ist sehr zerschossen; dann über die Schiffbrücke</mark> auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span><span class=\"context-right\"></span>",
-					 node.at("/snippet").asText());
-        assertEquals("GOE/AGA/01784", node.at("/textSigle").asText());
-        assertEquals("match-GOE/AGA/01784-p36-46(5)37-45(2)38-42",
-					 node.at("/matchID").asText());
-        assertEquals("Belagerung von Mainz", node.at("/title").asText());
-	};
-
-	
-	@Test
-	public void testMatchInfoGetWithHighlights () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)			
-			.path("corpus/GOE/AGA/01784/p36-46(5)37-45(2)38-42/matchInfo")
-			.queryParam("foundry", "xy")
-			.queryParam("spans", "false")
-			.queryParam("hls", "true")
-			.get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-					 response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertEquals("GOE/AGA/01784", node.at("/textSigle").asText());
-        assertEquals("<span class=\"context-left\"></span><span class=\"match\">der alte freie Weg nach Mainz war gesperrt, ich mußte über die Schiffbrücke bei Rüsselsheim; in Ginsheim ward <mark>gefüttert; <mark class=\"class-5 level-0\">der <mark class=\"class-2 level-1\">Ort ist sehr zerschossen; dann</mark> über die Schiffbrücke</mark></mark> auf die Nonnenaue, wo viele Bäume niedergehauen lagen, sofort auf dem zweiten Teil der Schiffbrücke über den größern Arm des Rheins.</span><span class=\"context-right\"></span>",
-					 node.at("/snippet").asText());
-		assertEquals("match-GOE/AGA/01784-p36-46(5)37-45(2)38-42",
-					 node.at("/matchID").asText());
-        assertEquals("Belagerung von Mainz", node.at("/title").asText());
-	};
-
-	
-	@Test
-	public void testMatchInfoGet2 () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-			
-			.path("corpus/GOE/AGA/01784/p36-46/matchInfo")
-			.queryParam("foundry", "*")
-			.get(ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-					 response.getStatus());
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertNotNull(node);
-        assertEquals("GOE/AGA/01784", node.at("/textSigle").asText());
-        assertEquals("Belagerung von Mainz", node.at("/title").asText());
-	};
-
-    @Test
-    public void testCollectionQueryParameter () throws KustvaktException{
-        ClientResponse response = resource().path(API_VERSION)
-                .path("query").queryParam("q", "[orth=das]")
-                .queryParam("ql", "poliqarp")
-                .queryParam("fields", "author, docSigle")
-                .queryParam("context", "sentence").queryParam("count", "13")
-                .queryParam("cq", "textClass=Politik & corpus=WPD")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String query = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertEquals("Politik", node.at("/collection/operands/0/value")
-                .asText());
-        assertEquals("WPD", node.at("/collection/operands/1/value").asText());
-
-        response = resource().path(API_VERSION).path("search")
-                .queryParam("q", "[orth=das]").queryParam("ql", "poliqarp")
-                .queryParam("fields", "author, docSigle")
-                .queryParam("context", "sentence").queryParam("count", "13")
-                .queryParam("cq", "textClass=Politik & corpus=WPD")
-                .get(ClientResponse.class);
-//        String version = LucenePackage.get().getImplementationVersion();;
-//        System.out.println("VERSION "+ version);
-//        System.out.println("RESPONSE "+ response);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        query = response.getEntity(String.class);
-        node = JsonUtils.readTree(query);
-        assertNotNull(node);
-        assertEquals("orth", node.at("/query/wrap/layer").asText());
-        assertEquals("Politik", node.at("/collection/operands/0/value")
-                .asText());
-        assertEquals("WPD", node.at("/collection/operands/1/value").asText());
-    }
-
-	@Test
-	public void testMetaFields () throws KustvaktException {
-        ClientResponse response = resource().path(API_VERSION)
-                .path("/corpus/GOE/AGA/01784")
-                .method("GET", ClientResponse.class);
-        assertEquals(ClientResponse.Status.OK.getStatusCode(),
-                response.getStatus());
-        String resp = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(resp);
-//		System.err.println(node.toString());
-
-		Iterator<JsonNode> fieldIter = node.at("/document/fields").elements();
-
-		int checkC = 0;
-		while (fieldIter.hasNext()) {
-			JsonNode field = (JsonNode) fieldIter.next();
-
-			String key = field.at("/key").asText();
-
-			assertEquals("koral:field", field.at("/@type").asText());
-
-			switch (key) {
-			case "textSigle":
-				assertEquals("type:string", field.at("/type").asText());
-				assertEquals("GOE/AGA/01784", field.at("/value").asText());
-				checkC++;
-				break;
-			case "author":
-				assertEquals("type:text", field.at("/type").asText());
-				assertEquals("Goethe, Johann Wolfgang von", field.at("/value").asText());
-				checkC++;
-				break;
-			case "docSigle":
-				assertEquals("type:string", field.at("/type").asText());
-				assertEquals("GOE/AGA", field.at("/value").asText());
-				checkC++;
-				break;
-			case "docTitle":
-				assertEquals("type:text", field.at("/type").asText());
-				assertEquals(
-					"Goethe: Autobiographische Schriften II, (1817-1825, 1832)",
-					field.at("/value").asText()
-					);
-				checkC++;
-				break;
-			case "pubDate":
-				assertEquals("type:date", field.at("/type").asText());
-				assertEquals(1982, field.at("/value").asInt());
-				checkC++;
-				break;
-			};		
-		};
-		assertEquals(5, checkC);
-	};
-	
-    @Test
-    public void testSearchWithoutVersion () throws KustvaktException {
-        ClientResponse response = resource().path("api").path("search")
-                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
-        URI location = response.getLocation();
-        assertEquals("/api/v1.0/search", location.getPath());
-    }
-
-    @Test
-    public void testSearchWrongVersion () throws KustvaktException {
-        ClientResponse response = resource().path("api").path("v0.2")
-                .path("search").queryParam("q", "[orth=der]")
-                .queryParam("ql", "poliqarp").accept(MediaType.APPLICATION_JSON)
-                .get(ClientResponse.class);
-        assertEquals(HttpStatus.PERMANENT_REDIRECT_308, response.getStatus());
-        URI location = response.getLocation();
-        assertEquals("/api/v1.0/search", location.getPath());
-    }
-}
diff --git a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteStatisticControllerTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteStatisticControllerTest.java
similarity index 97%
rename from full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteStatisticControllerTest.java
rename to lite/src/test/java/de/ids_mannheim/korap/web/service/LiteStatisticControllerTest.java
index e974c69..0efc39e 100644
--- a/full/src/test/java/de/ids_mannheim/korap/web/lite/controller/LiteStatisticControllerTest.java
+++ b/lite/src/test/java/de/ids_mannheim/korap/web/service/LiteStatisticControllerTest.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.web.lite.controller;
+package de.ids_mannheim.korap.web.service;
 
 import static org.junit.Assert.assertEquals;
 
diff --git a/lite/src/test/java/de/ids_mannheim/korap/web/service/VCReferenceTest.java b/lite/src/test/java/de/ids_mannheim/korap/web/service/VCReferenceTest.java
deleted file mode 100644
index 2a0bd0c..0000000
--- a/lite/src/test/java/de/ids_mannheim/korap/web/service/VCReferenceTest.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package de.ids_mannheim.korap.web.service;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.util.concurrent.ThreadLocalRandom;
-
-import org.junit.Test;
-import org.springframework.web.context.ContextLoaderListener;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.spi.spring.container.servlet.SpringServlet;
-import com.sun.jersey.test.framework.AppDescriptor;
-import com.sun.jersey.test.framework.JerseyTest;
-import com.sun.jersey.test.framework.WebAppDescriptor;
-import com.sun.jersey.test.framework.spi.container.TestContainerException;
-import com.sun.jersey.test.framework.spi.container.TestContainerFactory;
-import com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory;
-
-import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.utils.JsonUtils;
-
-public class VCReferenceTest extends JerseyTest{
-
-    public static final String API_VERSION = "v0.1";
-    public static final String classPackage = "de.ids_mannheim.korap.web.service.lite";
-    
-    @Override
-    protected TestContainerFactory getTestContainerFactory ()
-            throws TestContainerException {
-        return new GrizzlyWebTestContainerFactory();
-    }
-
-    @Override
-    protected AppDescriptor configure () {
-        return new WebAppDescriptor.Builder(classPackage)
-                .servletClass(SpringServlet.class)
-                .contextListenerClass(ContextLoaderListener.class)
-                .contextParam("contextConfigLocation",
-                        "classpath:lite-config.xml")
-                .build();
-    }
-
-    @Override
-    protected int getPort (int defaultPort) {
-        int port = ThreadLocalRandom.current().nextInt(5000, 8000 + 1);
-        try {
-            ServerSocket socket = new ServerSocket(port);
-            socket.close();
-        }
-        catch (IOException e) {
-            e.printStackTrace();
-            port = getPort(port);
-        }
-        return port;
-    }
-    
-    @Test
-    public void testSearchWithVCRef () throws KustvaktException {
-        ClientResponse response = resource().path(API_VERSION).path("search")
-                .queryParam("q", "[orth=der]").queryParam("ql", "poliqarp")
-                .queryParam("cq", "referTo named-vc1")
-                .get(ClientResponse.class);
-
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertTrue(node.at("/matches").size() > 0);
-
-    }
-    
-    @Test
-    public void testStatisticsWithVCReference () throws KustvaktException {
-        String corpusQuery = "referTo named-vc1";
-        ClientResponse response = resource().path(API_VERSION).path("statistics")
-                .queryParam("corpusQuery", corpusQuery)
-                .get(ClientResponse.class);
-
-        String ent = response.getEntity(String.class);
-        JsonNode node = JsonUtils.readTree(ent);
-        assertEquals(2, node.at("/documents").asInt());
-    }
-}
diff --git a/lite/src/test/resources/test-config.xml b/lite/src/test/resources/test-config.xml
new file mode 100644
index 0000000..abfb505
--- /dev/null
+++ b/lite/src/test/resources/test-config.xml
@@ -0,0 +1,181 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
+	xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans.xsd
+           http://www.springframework.org/schema/tx
+           http://www.springframework.org/schema/tx/spring-tx.xsd
+           http://www.springframework.org/schema/context
+           http://www.springframework.org/schema/context/spring-context.xsd
+           http://www.springframework.org/schema/util
+           http://www.springframework.org/schema/util/spring-util.xsd">
+
+
+	<context:component-scan
+		base-package="de.ids_mannheim.korap.web.filter, de.ids_mannheim.korap.web.utils,
+		de.ids_mannheim.korap.authentication.http" />
+	<context:annotation-config />
+
+	<bean id="placeholders"
+		class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:test-jdbc.properties</value>
+				<value>file:./test-jdbc.properties</value>
+				<value>classpath:hibernate.properties</value>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
+		</property>
+	</bean>
+
+	<bean id="properties"
+		class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+		<property name="ignoreResourceNotFound" value="true" />
+		<property name="locations">
+			<array>
+				<value>classpath:kustvakt-lite.conf</value>
+				<value>file:./kustvakt-lite.conf</value>
+			</array>
+		</property>
+	</bean>
+
+	<bean id="config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
+		<constructor-arg index="0" name="properties" ref="properties" />
+	</bean>
+
+	<!-- Database -->
+
+	<bean id="sqliteDataSource"
+		class="org.springframework.jdbc.datasource.SingleConnectionDataSource"
+		lazy-init="true">
+		<property name="driverClassName" value="${jdbc.driverClassName}" />
+		<property name="url" value="${jdbc.url}" />
+		<property name="username" value="${jdbc.username}" />
+		<property name="password" value="${jdbc.password}" />
+		<property name="connectionProperties">
+			<props>
+				<prop key="date_string_format">yyyy-MM-dd HH:mm:ss</prop>
+			</props>
+		</property>
+
+		<!-- relevant for single connection datasource and sqlite -->
+		<property name="suppressClose">
+			<value>true</value>
+		</property>
+		<!--<property name="initialSize" value="2"/> -->
+		<!--<property name="poolPreparedStatements" value="true"/> -->
+	</bean>
+
+	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+		<property name="baselineOnMigrate" value="true" />
+		<!-- <property name="validateOnMigrate" value="false" /> -->
+		<!-- <property name="cleanOnValidationError" value="true" /> -->
+		<property name="locations" value="${jdbc.schemaPath}" />
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<bean id="entityManagerFactory"
+		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+		<property name="dataSource" ref="sqliteDataSource" />
+
+		<property name="packagesToScan">
+			<array>
+				<value>de.ids_mannheim.korap.entity</value>
+			</array>
+		</property>
+		<property name="jpaVendorAdapter">
+			<bean id="jpaVendorAdapter"
+				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
+				<property name="databasePlatform" value="${hibernate.dialect}" />
+			</bean>
+		</property>
+		<property name="jpaProperties">
+			<props>
+				<prop key="hibernate.dialect">${hibernate.dialect}</prop>
+				<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
+				<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
+				<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
+				<prop key="hibernate.cache.use_second_level_cache">${hibernate.cache.use_second_level_cache}
+				</prop>
+				<prop key="hibernate.cache.provider_class">${hibernate.cache.provider}</prop>
+				<prop key="hibernate.cache.region.factory_class">${hibernate.cache.region.factory}</prop>
+				<prop key="hibernate.jdbc.time_zone">${hibernate.jdbc.time_zone}</prop>
+			</props>
+		</property>
+	</bean>
+	<tx:annotation-driven proxy-target-class="true"
+		transaction-manager="transactionManager" />
+
+	<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
+		<property name="entityManagerFactory" ref="entityManagerFactory" />
+	</bean>
+
+	<bean id="transactionTemplate"
+		class="org.springframework.transaction.support.TransactionTemplate">
+		<constructor-arg ref="transactionManager" />
+	</bean>
+	<bean id="txManager"
+		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
+		<property name="dataSource" ref="sqliteDataSource" />
+	</bean>
+
+	<!-- Initialization -->
+	<bean id="initializator" class="de.ids_mannheim.de.init.LiteInitializatorImpl"
+		init-method="init">
+	</bean>
+	<bean id="annotationParser" class="de.ids_mannheim.korap.annotation.AnnotationParser"
+		scope="singleton" />
+
+	<!-- Krill -->
+	<bean id="search_krill" class="de.ids_mannheim.korap.web.SearchKrill">
+		<constructor-arg value="${krill.indexDir}" />
+	</bean>
+
+	<!-- Filters -->
+	<bean id="APIVersionFilter" class="de.ids_mannheim.korap.web.APIVersionFilter"
+		scope="singleton" />
+
+	<!-- Authentication -->
+	<bean id="authenticationManager"
+		class="de.ids_mannheim.korap.authentication.DummyAuthenticationManager" />
+
+	<!-- Response handler -->
+	<bean id="kustvaktResponseHandler" class="de.ids_mannheim.korap.web.KustvaktResponseHandler">
+		<constructor-arg index="0" name="iface" ref="kustvakt_auditing" />
+	</bean>
+
+	<!-- Controllers -->
+	<bean id="annotationController"
+		class="de.ids_mannheim.korap.web.controller.AnnotationController" />
+	<bean id="searchController" class="de.ids_mannheim.korap.web.controller.SearchController" />
+	<bean id="statisticController"
+		class="de.ids_mannheim.korap.web.controller.StatisticController" />
+
+	<!-- Services -->
+	<bean id="annotationService" class="de.ids_mannheim.korap.service.AnnotationService"></bean>
+	<bean id="scopeService"
+		class="de.ids_mannheim.korap.oauth2.service.DummyOAuth2ScopeServiceImpl" />
+	<bean id="searchService" class="de.ids_mannheim.korap.service.SearchService"></bean>
+
+	<!-- DAO -->
+	<bean id="adminDao" class="de.ids_mannheim.korap.dao.DummyAdminDaoImpl" />
+	<bean id="annotationDao" class="de.ids_mannheim.korap.dao.AnnotationDao" />
+
+	<!-- DTO Converter -->
+	<bean id="annotationConverter" class="de.ids_mannheim.korap.dto.converter.AnnotationConverter" />
+
+	<!-- Rewrite -->
+	<bean id="rewriteHandler" class="de.ids_mannheim.korap.resource.rewrite.RewriteHandler">
+		<constructor-arg ref="config" />
+	</bean>
+
+
+
+	<bean id="kustvakt_auditing"
+		class="de.ids_mannheim.korap.interfaces.defaults.DefaultAuditing">
+	</bean>
+
+</beans>
\ No newline at end of file
diff --git a/full/src/main/resources/properties/lite-jdbc.properties b/lite/src/test/resources/test-jdbc.properties
similarity index 87%
copy from full/src/main/resources/properties/lite-jdbc.properties
copy to lite/src/test/resources/test-jdbc.properties
index 5aa9ca8..99e2e54 100644
--- a/full/src/main/resources/properties/lite-jdbc.properties
+++ b/lite/src/test/resources/test-jdbc.properties
@@ -6,4 +6,4 @@
 jdbc.url=jdbc:sqlite:liteDB.sqlite
 jdbc.username=pc
 jdbc.password=pc
-jdbc.schemaPath=db.lite-sqlite
\ No newline at end of file
+jdbc.schemaPath=db
\ No newline at end of file