Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java	(revision 63)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotations.java	(revision 65)
@@ -6,4 +6,6 @@
 
 import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
@@ -50,7 +52,16 @@
         setCorsHeaders();
         // id from URI /annotations/{id}
+        String id = null;
         String jsonId = (String) getRequest().getAttributes().get("id");
-        String id = decodeJsonId(jsonId);
-        logger.debug("annotation-id=" + id);
+        if (jsonId != null) {
+            // URL decode
+            try {
+                jsonId = URLDecoder.decode(jsonId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
+            id = decodeJsonId(jsonId);
+            logger.debug("annotation-id=" + id);
+        }
 
         // do authentication
@@ -87,10 +98,11 @@
         AnnotationStore store = getAnnotationStore();
         ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-        
+
         // read all annotations
         List<Annotation> annotations = store.getAnnotations(null, null);
         for (Annotation annotation : annotations) {
             // check permission
-            if (!annotation.isActionAllowed("read", authUser, store)) continue;
+            if (!annotation.isActionAllowed("read", authUser, store))
+                continue;
             // add annotation to list
             JSONObject jo = createAnnotatorJson(annotation, false);
@@ -102,5 +114,5 @@
             JSONObjectComparator.sortAnnotations(results, sortBy);
         }
-        
+
         // put in JSON list
         JSONArray rows = new JSONArray();
@@ -108,7 +120,9 @@
         for (JSONObject result : results) {
             cnt += 1;
-            if (offset > 0 && cnt < offset) continue;
+            if (offset > 0 && cnt < offset)
+                continue;
             rows.put(result);
-            if (limit > 0 && cnt >= limit) break;
+            if (limit > 0 && cnt >= limit)
+                break;
         }
 
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByResources.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByResources.java	(revision 50)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByResources.java	(revision 65)
@@ -1,4 +1,6 @@
 package de.mpiwg.itgroup.annotations.restlet;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
@@ -23,5 +25,5 @@
  * 
  * @author dwinter
- *
+ * 
  */
 public class AnnotatorAnnotationsByResources extends AnnotatorResourceImpl {
@@ -29,68 +31,72 @@
         return "OPTIONS,GET";
     }
-    
+
     @Get("json")
     public Representation doGetJSON(Representation entity) {
         logger.debug("AnnotatorAnnotatonsByResource doGetJSON!");
         setCorsHeaders();
-       
+
         // do authentication
         Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
         logger.debug("request authenticated=" + authUser);
 
-        
+        String id = null;
         String jsonId = (String) getRequest().getAttributes().get("id");
-       
+        if (jsonId != null) {
+            // URL decode
+            try {
+                jsonId = URLDecoder.decode(jsonId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
+            id = decodeJsonId(jsonId);
+            // String id = jsonId;
+            logger.debug("ressource-id=" + id);
+        }
+
         Form form = getRequest().getResourceRef().getQueryAsForm();
-        String sortBy=null;
+        String sortBy = null;
         for (Parameter parameter : form) {
-          if (parameter.getName().equals("sortBy")){
-          sortBy =  parameter.getValue();
-          }
+            if (parameter.getName().equals("sortBy")) {
+                sortBy = parameter.getValue();
+            }
         }
-        
-        String id = decodeJsonId(jsonId);
-        //String id = jsonId;
-        logger.debug("ressource-id=" + id);
-        
+
         AnnotationStore store = getAnnotationStore();
-  	  	//String tagUri=NS.MPIWG_TAGS_URL+id;
+        // String tagUri=NS.MPIWG_TAGS_URL+id;
         List<Annotation> annotations = store.getAnnotationsByResource(id);
-        
-		//JSONArray results = new JSONArray();
+
+        // JSONArray results = new JSONArray();
         ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-        
-		for (Annotation annot : annotations) {
-			//check permission
-			if (!annot.isActionAllowed("read", authUser, store)) continue;
-            
-			JSONObject jo = createAnnotatorJson(annot,false);
+
+        for (Annotation annot : annotations) {
+            // check permission
+            if (!annot.isActionAllowed("read", authUser, store))
+                continue;
+
+            JSONObject jo = createAnnotatorJson(annot, false);
             results.add(jo);
         }
-    
-	if (sortBy!=null){
-		JSONObjectComparator.sortAnnotations(results,sortBy);
-	}
-		
-	JSONArray resultsJa = new JSONArray();
-	for (JSONObject result:results){
-		resultsJa.put(result);
-	}
-	
-    // assemble result object
-    JSONObject result = new JSONObject();
-    try {
-        result.put("rows", resultsJa);
-        result.put("total", resultsJa.length());
-    } catch (JSONException e) {
-        setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-        return null;
+
+        if (sortBy != null) {
+            JSONObjectComparator.sortAnnotations(results, sortBy);
+        }
+
+        JSONArray resultsJa = new JSONArray();
+        for (JSONObject result : results) {
+            resultsJa.put(result);
+        }
+
+        // assemble result object
+        JSONObject result = new JSONObject();
+        try {
+            result.put("rows", resultsJa);
+            result.put("total", resultsJa.length());
+        } catch (JSONException e) {
+            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
+            return null;
+        }
+        return new JsonRepresentation(result);
     }
-    logger.debug("sending:");
-    logger.debug(result);
-    return new JsonRepresentation(result);
+
 }
-
-    
-	
-}
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByTags.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByTags.java	(revision 58)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorAnnotationsByTags.java	(revision 65)
@@ -1,4 +1,6 @@
 package de.mpiwg.itgroup.annotations.restlet;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.ArrayList;
 import java.util.List;
@@ -8,5 +10,4 @@
 import org.json.JSONObject;
 import org.restlet.data.Form;
-import org.restlet.data.Parameter;
 import org.restlet.data.Status;
 import org.restlet.ext.json.JsonRepresentation;
@@ -23,5 +24,5 @@
  * 
  * @author dwinter
- *
+ * 
  */
 public class AnnotatorAnnotationsByTags extends AnnotatorResourceImpl {
@@ -29,68 +30,62 @@
         return "OPTIONS,GET";
     }
-    
+
     @Get("json")
     public Representation doGetJSON(Representation entity) {
         logger.debug("AnnotatorAnnotatonsBytag doGetJSON!");
         setCorsHeaders();
-       
+
         // do authentication
         Person authUser = Person.createPersonWithId(this.checkAuthToken(entity));
         logger.debug("request authenticated=" + authUser);
 
-        
-        String jsonId = (String) getRequest().getAttributes().get("id");
-        
+        String id = (String) getRequest().getAttributes().get("id");
+        // URL decode
+        try {
+            id = URLDecoder.decode(id, "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            // this shouldn't happen
+        }
+        logger.debug("annotation-id=" + id);
+
         Form form = getRequest().getResourceRef().getQueryAsForm();
-        String sortBy=null;
-        for (Parameter parameter : form) {
-          if (parameter.getName().equals("sortBy")){
-          sortBy =  parameter.getValue();
-          }
-        }
-        
-        //String id = decodeJsonId(jsonId);
-        String id = jsonId;
-        logger.debug("annotation-id=" + id);
-        
+        String sortBy = form.getFirstValue("sortBy");
+
         AnnotationStore store = getAnnotationStore();
         String tagUri = BaseRestlet.TAGS_URI_PREFIX + id;
         List<Annotation> annotations = store.getAnnotationsByTag(tagUri);
-        
-		//JSONArray results = new JSONArray();
+
+        // JSONArray results = new JSONArray();
         ArrayList<JSONObject> results = new ArrayList<JSONObject>();
-        
-		for (Annotation annot : annotations) {
-			//check permission
-			if (!annot.isActionAllowed("read", authUser, store)) continue;
-            
-			JSONObject jo = createAnnotatorJson(annot,false);
+
+        for (Annotation annot : annotations) {
+            // check permission
+            if (!annot.isActionAllowed("read", authUser, store))
+                continue;
+
+            JSONObject jo = createAnnotatorJson(annot, false);
             results.add(jo);
         }
-    
-	if (sortBy!=null){
-		JSONObjectComparator.sortAnnotations(results,sortBy);
-	}
-		
-	JSONArray resultsJa = new JSONArray();
-	for (JSONObject result:results){
-		resultsJa.put(result);
-	}
-	
-    // assemble result object
-    JSONObject result = new JSONObject();
-    try {
-        result.put("rows", resultsJa);
-        result.put("total", resultsJa.length());
-    } catch (JSONException e) {
-        setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
-        return null;
+
+        if (sortBy != null) {
+            JSONObjectComparator.sortAnnotations(results, sortBy);
+        }
+
+        JSONArray resultsJa = new JSONArray();
+        for (JSONObject result : results) {
+            resultsJa.put(result);
+        }
+
+        // assemble result object
+        JSONObject result = new JSONObject();
+        try {
+            result.put("rows", resultsJa);
+            result.put("total", resultsJa.length());
+        } catch (JSONException e) {
+            setStatus(Status.SERVER_ERROR_INTERNAL, "JSON Error");
+            return null;
+        }
+        return new JsonRepresentation(result);
     }
-    logger.debug("sending:");
-    logger.debug(result);
-    return new JsonRepresentation(result);
+
 }
-
-    
-	
-}
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java	(revision 61)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorResources.java	(revision 65)
@@ -4,4 +4,6 @@
 package de.mpiwg.itgroup.annotations.restlet;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.List;
 
@@ -42,4 +44,12 @@
 
         String jsonId = (String) getRequest().getAttributes().get("id");
+        if (jsonId != null) {
+            // URL decode
+            try {
+                jsonId = URLDecoder.decode(jsonId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
+        }
         String uri = decodeJsonId(jsonId);
 
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorTags.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorTags.java	(revision 58)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/AnnotatorTags.java	(revision 65)
@@ -4,4 +4,6 @@
 package de.mpiwg.itgroup.annotations.restlet;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.util.List;
 
@@ -18,10 +20,9 @@
 import de.mpiwg.itgroup.annotations.neo4j.AnnotationStore;
 
-
 /**
  * API for accessing tags in the Annotation store.
  * 
  * @author dwinter
- *
+ * 
  */
 public class AnnotatorTags extends AnnotatorResourceImpl {
@@ -31,9 +32,9 @@
 
     /**
-     * GET with JSON content-type.
+     * GET with JSON content-type. 
      * Parameters: 
-     *   user: short user name
+     *   user: short user name 
      *   uri: user uri
-     *   
+     * 
      * @param entity
      * @return
@@ -43,50 +44,55 @@
         logger.debug("AnnotatorGroups doGetJSON!");
         setCorsHeaders();
-       
+
         String jsonId = (String) getRequest().getAttributes().get("id");
-        //String id = decodeJsonId(jsonId);
+        // String id = decodeJsonId(jsonId);
         String id = jsonId;
         logger.debug("annotation-id=" + id);
 
-        if (id==null){
-        return getAllTags();
+        if (id == null) {
+            return getAllTags();
         } else {
-
-        	return getTag(id);
+            // URL decode
+            try {
+                id = URLDecoder.decode(id, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
+            return getTag(id);
         }
     }
-    
-    protected Representation getTag(String id){
-    	  AnnotationStore store = getAnnotationStore();
-    	  String tagUri = BaseRestlet.TAGS_URI_PREFIX + id;
-          Node tagNode = store.getTagNodeByUri(tagUri);
-          Tag tag = store.createTagFromNode(tagNode);
-          JSONObject jo = new JSONObject();
-          try {
-              jo.put("id", tag.getId());
-              jo.put("name", tag.getName());
-              jo.put("uri", tag.getUri());
-          } catch (JSONException e) {
-          }
-          
-          return new JsonRepresentation(jo);
+
+    protected Representation getTag(String id) {
+        AnnotationStore store = getAnnotationStore();
+        String tagUri = BaseRestlet.TAGS_URI_PREFIX + id;
+        Node tagNode = store.getTagNodeByUri(tagUri);
+        Tag tag = store.createTagFromNode(tagNode);
+        JSONObject jo = new JSONObject();
+        try {
+            jo.put("id", tag.getId());
+            jo.put("name", tag.getName());
+            jo.put("uri", tag.getUri());
+        } catch (JSONException e) {
+        }
+
+        return new JsonRepresentation(jo);
     }
-	protected Representation getAllTags() {
-		JSONArray results = new JSONArray();
+
+    protected Representation getAllTags() {
+        JSONArray results = new JSONArray();
         AnnotationStore store = getAnnotationStore();
-        
-       
-            List<Tag> tags = store.getTags(null, null);
-            for (Tag tag : tags) {
-                JSONObject jo = new JSONObject();
-                try {
-                    jo.put("id", tag.getId());
-                    jo.put("name", tag.getName());
-                    jo.put("uri", tag.getUri());
-                } catch (JSONException e) {
-                }
-                results.put(jo);
+
+        List<Tag> tags = store.getTags(null, null);
+        for (Tag tag : tags) {
+            JSONObject jo = new JSONObject();
+            try {
+                jo.put("id", tag.getId());
+                jo.put("name", tag.getName());
+                jo.put("uri", tag.getUri());
+            } catch (JSONException e) {
             }
-        
+            results.put(jo);
+        }
+
         // assemble result object
         JSONObject result = new JSONObject();
@@ -101,7 +107,5 @@
         logger.debug(result);
         return new JsonRepresentation(result);
-	}        	
-        
+    }
 
-    
 }
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java	(revision 50)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/AnnotationResource.java	(revision 65)
@@ -3,4 +3,7 @@
  */
 package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 
 import org.apache.log4j.Logger;
@@ -49,4 +52,10 @@
         // get annotation from store
         if (requestId != null) {
+            // URL decode
+            try {
+                requestId = URLDecoder.decode(requestId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
             // the ID in the path is encoded
             String id = Annotation.decodeId(requestId);
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupResource.java	(revision 32)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/GroupResource.java	(revision 65)
@@ -3,4 +3,7 @@
  */
 package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 
 import org.apache.log4j.Logger;
@@ -49,4 +52,10 @@
         // get group from store
         if (requestId != null) {
+            // URL decode
+            try {
+                requestId = URLDecoder.decode(requestId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
             group = (Group) store.getActor(new Group(requestId));
         }
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java	(revision 32)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonResource.java	(revision 65)
@@ -3,4 +3,7 @@
  */
 package de.mpiwg.itgroup.annotations.restlet.annotations_ui;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 
 import org.apache.log4j.Logger;
@@ -42,11 +45,17 @@
         // id from URI /annotations/persons/{id}
         requestId = (String) getRequest().getAttributes().get("id");
-        logger.debug("group-id=" + requestId);
+        logger.debug("person-id=" + requestId);
         // get store instance
         if (store == null) {
             store = ((BaseRestlet) getApplication()).getAnnotationStore();
         }
-        // get group from store
+        // get person from store
         if (requestId != null) {
+            // URL decode
+            try {
+                requestId = URLDecoder.decode(requestId, "UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                // this shouldn't happen
+            }
             person = (Person) store.getActor(new Person(requestId));
         }
Index: src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java
===================================================================
--- src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java	(revision 50)
+++ src/main/java/de/mpiwg/itgroup/annotations/restlet/annotations_ui/PersonsResource.java	(revision 65)
@@ -57,5 +57,5 @@
         String form = f.getFirstValue("form");
         if (form != null && form.equals("new_person")) {
-            // output new group form
+            // output new person form
             result = "<html><body>\n";
             result += "<h1>New person</h1>\n";
@@ -69,5 +69,5 @@
             result += "</form>\n</body>\n</html>";
         } else {
-            // list all groups
+            // list all persons
             result = "<html><body>\n<h1>Persons</h1>\n<table>";
             result += "<tr><th>id</th><th>name</th><th>uri</th></tr>";
@@ -75,5 +75,5 @@
             for (Person person : persons) {
                 Reference url = this.getReference().clone();
-                url.addSegment(person.getId());
+                url.addSegment(person.getIdString());
                 result += String.format("<tr><td><a href=\"%s\">%s</a></td><td>%s</td><td>%s</td></tr>\n", url,
                         person.getIdString(), person.getName(), person.getUri());
@@ -87,5 +87,5 @@
 
     /**
-     * POST creates a new Group.
+     * POST creates a new person.
      * 
      * @return
