diff --git a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
index ccc79d8..a6cf827 100644
--- a/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
+++ b/src/main/java/de/ids_mannheim/korap/interfaces/AuthenticationManagerIface.java
@@ -1,10 +1,7 @@
 package de.ids_mannheim.korap.interfaces;
 
 import de.ids_mannheim.korap.exceptions.KustvaktException;
-import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserDetails;
-import de.ids_mannheim.korap.user.UserSettings;
+import de.ids_mannheim.korap.user.*;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -57,10 +54,15 @@
     public abstract User createUserAccount(Map attributes,
             boolean confirmation_required) throws KustvaktException;
 
-//    public abstract boolean updateAccount(User user) throws KustvaktException;
+    //    public abstract boolean updateAccount(User user) throws KustvaktException;
 
     public abstract boolean deleteAccount(User user) throws KustvaktException;
 
+    public abstract <T extends Userdata> T getUserData(User user,
+            Class<T> clazz) throws KustvaktException;
+
+    public abstract void updateUserData(Userdata data) throws KustvaktException;
+
     public abstract UserDetails getUserDetails(User user)
             throws KustvaktException;
 
diff --git a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
index 306eade..8cd65eb 100644
--- a/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
+++ b/src/main/java/de/ids_mannheim/korap/security/auth/KustvaktAuthenticationManager.java
@@ -146,6 +146,7 @@
         return user;
     }
 
+    // todo: dont use annotations for caching
     @CachePut(value = "users", key = "#user.getUsername()")
     public TokenContext createTokenContext(User user, Map<String, String> attr,
             String provider_key) throws KustvaktException {
@@ -153,7 +154,7 @@
                 Attributes.API_AUTHENTICATION);
 
         if (attr.get(Attributes.SCOPES) != null)
-            this.getUserDetails(user);
+            this.getUserData(user, Userdetails2.class);
 
         TokenContext context = provider.createUserSession(user, attr);
         if (context == null)
@@ -634,7 +635,7 @@
                     username), StatusCodes.PASSWORD_RESET_FAILED, username);
         }
 
-        getUserDetails(ident);
+        this.getUserData(ident, Userdetails2.class);
         KorAPUser user = (KorAPUser) ident;
         if (!mail.equals(user.getDetails().getEmail()))
             //            throw new NotAuthorizedException(StatusCodes.ILLEGAL_ARGUMENT,
@@ -694,12 +695,14 @@
         }
     }
 
+    @Override
     public <T extends Userdata> T getUserData(User user, Class<T> clazz) {
         UserDataDbIface<T> dao = UserdataFactory.getDaoInstance(clazz);
         return dao.get(user);
     }
 
     //todo: cache userdata outside of the user object!
+    @Override
     public void updateUserData(Userdata data) {
         UserDataDbIface dao = UserdataFactory.getDaoInstance(data.getClass());
         dao.update(data);
diff --git a/src/main/java/de/ids_mannheim/korap/user/User.java b/src/main/java/de/ids_mannheim/korap/user/User.java
index 0806d2e..5cc1403 100644
--- a/src/main/java/de/ids_mannheim/korap/user/User.java
+++ b/src/main/java/de/ids_mannheim/korap/user/User.java
@@ -31,7 +31,7 @@
     private UserDetails details;
     private List<UserQuery> queries;
 
-    private List<? extends Userdata> userdata;
+    private List<Userdata> userdata;
 
     protected User() {
         this.fields = new ParamFields();
@@ -73,6 +73,17 @@
         }
     }
 
+    public void addUserData(Userdata data) {
+        if (data != null) {
+            for (Userdata d : this.userdata) {
+                // already has an object of that type!
+                if (d.getClass().equals(data.getClass()))
+                    return;
+            }
+            userdata.add(data);
+        }
+    }
+
     @Deprecated
     public void setDetails(UserDetails details) {
         if (details != null)
diff --git a/src/main/java/de/ids_mannheim/korap/user/Userdata.java b/src/main/java/de/ids_mannheim/korap/user/Userdata.java
index 1ffdfe1..42d8247 100644
--- a/src/main/java/de/ids_mannheim/korap/user/Userdata.java
+++ b/src/main/java/de/ids_mannheim/korap/user/Userdata.java
@@ -57,7 +57,17 @@
     }
 
     public boolean isValid() {
-        return this.missing(this.fields).isEmpty() && this.userID != -1;
+        //        return this.missing(this.fields).isEmpty() && this.userID != -1;
+        return validationReturn().length == 0;
+    }
+
+    public String[] validationReturn() {
+        StringBuilder b = new StringBuilder();
+        Set<String> m = missing(this.fields);
+        for (String k : m) {
+            b.append(k).append(";");
+        }
+        return b.toString().split(";");
     }
 
     public Set<String> keys() {
@@ -74,6 +84,17 @@
             this.fields.putAll(m);
     }
 
+    public void update(Userdata other) {
+        if (other != null && this.getClass().equals(other.getClass())) {
+            if (!other.isValid()) {
+                throw new RuntimeException(
+                        "User data object not valid. Missing fields: "
+                                + missing(this.fields));
+            }
+            this.fields.putAll(other.fields);
+        }
+    }
+
     public String data() {
         return JsonUtils.toJSON(this.fields);
     }
@@ -84,5 +105,4 @@
 
     public abstract String[] requiredFields();
 
-
 }
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
index f53c816..05f3c53 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
@@ -7,10 +7,7 @@
 import de.ids_mannheim.korap.exceptions.StatusCodes;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
-import de.ids_mannheim.korap.user.Attributes;
-import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.user.User;
-import de.ids_mannheim.korap.user.UserSettings;
+import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
 import de.ids_mannheim.korap.utils.ServiceVersion;
@@ -118,7 +115,9 @@
         TokenContext context;
         try {
             User user = controller.authenticate(0, values[0], values[1], attr);
-            this.controller.getUserDetails(user);
+            Userdata data = this.controller
+                    .getUserData(user, Userdetails2.class);
+            user.addUserData(data);
             context = controller.createTokenContext(user, attr,
                     Attributes.API_AUTHENTICATION);
         }catch (KustvaktException e) {
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
index 11fc0b3..9e85bbf 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
@@ -8,9 +8,7 @@
 import de.ids_mannheim.korap.handlers.OAuth2Handler;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
-import de.ids_mannheim.korap.user.Attributes;
-import de.ids_mannheim.korap.user.TokenContext;
-import de.ids_mannheim.korap.user.User;
+import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.web.KustvaktServer;
@@ -127,7 +125,9 @@
         User user;
         try {
             user = this.controller.getUser(ctx.getUsername());
-            this.controller.getUserDetails(user);
+            Userdata data = this.controller
+                    .getUserData(user, Userdetails2.class);
+            user.addUserData(data);
             Set<String> base_scope = StringUtils.toSet(scopes, " ");
             base_scope.retainAll(StringUtils.toSet(scopes));
             scopes = StringUtils.toString(base_scope);
@@ -136,8 +136,8 @@
         }
         // json format with scope callback parameter
         // todo: add other scopes as well!
-        return Response.ok(JsonUtils.toJSON(Scopes
-                .mapScopes(scopes, user.getDetails()))).build();
+        return Response.ok(JsonUtils
+                .toJSON(Scopes.mapScopes(scopes, user.getDetails()))).build();
     }
 
     @GET
@@ -198,7 +198,9 @@
 
             try {
                 user = controller.getUser(c.getUsername());
-                controller.getUserDetails(user);
+                Userdata data = controller
+                        .getUserData(user, Userdetails2.class);
+                user.addUserData(data);
             }catch (KustvaktException e) {
                 throw KustvaktResponseHandler.throwit(e);
             }
@@ -540,7 +542,10 @@
                         user = controller
                                 .authenticate(0, oauthRequest.getUsername(),
                                         oauthRequest.getPassword(), attr);
-                    controller.getUserDetails(user);
+                    Userdata data = controller
+                            .getUserData(user, Userdetails2.class);
+                    user.addUserData(data);
+
                     attr.put(Attributes.CLIENT_SECRET,
                             oauthRequest.getClientSecret());
                     TokenContext c = controller.createTokenContext(user, attr,
diff --git a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
index d76d02f..b342e84 100644
--- a/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
+++ b/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
@@ -220,7 +220,10 @@
         User user;
         try {
             user = controller.getUser(ctx.getUsername());
-            controller.getUserDetails(user);
+            Userdata data = controller
+                    .getUserData(user, Userdetails2.class);
+            user.addUserData(data);
+
             Set<String> base_scope = StringUtils.toSet(scopes, " ");
             if (scopes != null)
                 base_scope.retainAll(StringUtils.toSet(scopes));
@@ -297,7 +300,10 @@
         User user;
         try {
             user = controller.getUser(ctx.getUsername());
-            controller.getUserDetails(user);
+            Userdata data = controller
+                    .getUserData(user, Userdetails2.class);
+            user.addUserData(data);
+
         }catch (KustvaktException e) {
             jlog.error("Exception encountered!", e);
             throw KustvaktResponseHandler.throwit(e);
diff --git a/src/test/java/UserdataTest.java b/src/test/java/UserdataTest.java
index a10a480..ea47a99 100644
--- a/src/test/java/UserdataTest.java
+++ b/src/test/java/UserdataTest.java
@@ -59,6 +59,18 @@
     }
 
     @Test
+    public void testDataValidation() {
+        Userdata data = new Userdetails2(1);
+        data.addField(Attributes.COUNTRY, "Germany");
+
+        String[] req = data.requiredFields();
+        String[] r = data.validationReturn();
+        assert r.length > 0;
+        assert r.length == req.length;
+        assert !data.isValid();
+    }
+
+    @Test
     public void testUserdatafactory() {
         UserDataDbIface dao = UserdataFactory
                 .getDaoInstance(Userdetails2.class);
