diff --git a/src/main/java/de/ids_mannheim/korap/dto/ResourceDto.java b/src/main/java/de/ids_mannheim/korap/dto/ResourceDto.java
index 3a14423..acf2001 100644
--- a/src/main/java/de/ids_mannheim/korap/dto/ResourceDto.java
+++ b/src/main/java/de/ids_mannheim/korap/dto/ResourceDto.java
@@ -1,11 +1,13 @@
 package de.ids_mannheim.korap.dto;
 
+import java.util.List;
 import java.util.Map;
 
 import lombok.Getter;
 import lombok.Setter;
 
-/** Data transfer object for resource description (e.g. for KorapSRU). 
+/**
+ * Data transfer object for resource description (e.g. for KorapSRU).
  * 
  * @author margaretha
  *
@@ -15,18 +17,16 @@
 public class ResourceDto {
 
     private String resourceId;
-    private String germanTitle;
-    private String englishTitle;
+    private Map<String, String> titles;
     private String description;
+    private String[] languages;
     private Map<Integer, String> layers;
-    private Map<String, String> languages;
 
 
     @Override
     public String toString () {
-        return "resourceId= " + resourceId + ", germanTitle= " + germanTitle
-                + ", englishTitle= " + englishTitle + ", description= "
-                + description + ", languages= " + languages + ", layers= "
-                + layers;
+        return "resourceId= " + resourceId + ", description= " + description
+                + ", titles= " + titles + ", languages= " + languages
+                + ", layers= " + layers;
     }
 }
diff --git a/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java b/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
index f79119d..03f00b3 100644
--- a/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
+++ b/src/main/java/de/ids_mannheim/korap/dto/converter/ResourceConverter.java
@@ -17,19 +17,18 @@
     public List<ResourceDto> convertToResourcesDto (List<Resource> resources) {
         List<ResourceDto> resourceDtoList = new ArrayList<ResourceDto>(resources.size());
         ResourceDto dto;
-        Map<String, String> languages;
+        Map<String, String> titles;
         HashMap<Integer, String> layers;
         for (Resource r: resources){
             dto = new ResourceDto();
             dto.setDescription(r.getEnglishDescription());
-            dto.setEnglishTitle(r.getEnglishTitle());
-            dto.setGermanTitle(r.getGermanTitle());
             dto.setResourceId(r.getId());
+            dto.setLanguages(new String[]{"deu"});
             
-            languages = new HashMap<String, String>();
-            languages.put("en", r.getEnglishTitle());
-            languages.put("de", r.getGermanTitle());
-            dto.setLanguages(languages);
+            titles = new HashMap<String, String>();
+            titles.put("en", r.getEnglishTitle());
+            titles.put("de", r.getGermanTitle());
+            dto.setTitles(titles);
             
             layers = new HashMap<Integer, String>();
             String foundry, layer, code;
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
index 917baa4..102ed8b 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
@@ -25,6 +25,7 @@
 import de.ids_mannheim.korap.dto.LayerDto;
 import de.ids_mannheim.korap.dto.converter.AnnotationConverter;
 import de.ids_mannheim.korap.entity.AnnotationPair;
+import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.web.filter.AuthFilter;
@@ -85,8 +86,8 @@
     public Response getFoundryDescriptions (String json) {
         JsonNode node = JsonUtils.readTree(json);
         if (node == null) {
-            throw KustvaktResponseHandler.throwit(StatusCodes.MISSING_ARGUMENT,
-                    "Missing a json string.");
+            throw KustvaktResponseHandler.throwit(new KustvaktException(
+                    StatusCodes.MISSING_ARGUMENT, "Missing a json string.", ""));
         }
 
         String language;
@@ -100,8 +101,8 @@
             }
             else if (!(language.equals("en") || language.equals("de"))) {
                 throw KustvaktResponseHandler.throwit(
-                        StatusCodes.UNSUPPORTED_VALUE, "Unsupported value:",
-                        language);
+                        new KustvaktException(StatusCodes.UNSUPPORTED_VALUE,
+                                "Unsupported value:", language));
             }
         }
 
@@ -110,14 +111,19 @@
             codes = JsonUtils.convert(node.get("codes"), List.class);
         }
         catch (IOException | NullPointerException e) {
-            throw KustvaktResponseHandler.throwit(StatusCodes.INVALID_ARGUMENT,
-                    "Bad argument:", json);
+            throw KustvaktResponseHandler.throwit(new KustvaktException(
+                    StatusCodes.INVALID_ARGUMENT, "Bad argument:", json));
         }
         if (codes == null) {
-            throw KustvaktResponseHandler.throwit(StatusCodes.MISSING_ATTRIBUTE,
-                    "Missing attribute:", "codes");
+            throw KustvaktResponseHandler.throwit(
+                    new KustvaktException(StatusCodes.MISSING_ATTRIBUTE,
+                            "Missing attribute:", "codes"));
         }
-
+        else if (codes.isEmpty()) {
+            throw KustvaktResponseHandler.throwit(new KustvaktException(
+                    StatusCodes.NO_VALUE_FOUND, "No result found.","codes:[]"));
+        }
+        
         List<AnnotationPair> annotationPairs = null;
         String foundry = "", layer = "";
         if (codes.contains("*")) {
@@ -140,8 +146,8 @@
                 else {
                     jlog.error("Annotation code is wrong: " + annotationCode);
                     throw KustvaktResponseHandler.throwit(
-                            StatusCodes.INVALID_ATTRIBUTE, "Bad attribute:",
-                            code);
+                            new KustvaktException(StatusCodes.INVALID_ATTRIBUTE,
+                                    "Bad attribute:", code));
                 }
 
                 annotationPairs.addAll(annotationDao
@@ -152,13 +158,13 @@
         if (annotationPairs != null && !annotationPairs.isEmpty()) {
             List<FoundryDto> dtos = annotationConverter
                     .convertToFoundryDto(annotationPairs, language);
-            jlog.debug("/layers " + annotationPairs.toString());
+            jlog.debug("/description " + annotationPairs.toString());
             String result = JsonUtils.toJSON(dtos);
             return Response.ok(result).build();
         }
         else {
-            throw KustvaktResponseHandler.throwit(StatusCodes.NO_VALUE_FOUND,
-                    "No result found.");
+            throw KustvaktResponseHandler.throwit(new KustvaktException(
+                    StatusCodes.NO_VALUE_FOUND, "No result found.",""));
         }
     }
 
