diff --git a/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java b/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
index f24956b..5319d46 100644
--- a/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
+++ b/src/main/java/de/ids_mannheim/korap/constant/OAuth2Scope.java
@@ -25,7 +25,7 @@
 
     DELETE_USER_GROUP_MEMBER, ADD_USER_GROUP_MEMBER,
 
-    EDIT_USER_GROUP_MEMBER_ROLE, ADD_USER_GROUP_MEMBER_ROLE, DELETE_USER_GROUP_MEMBER_ROLE,
+    ADD_MEMBER_ROLE, DELETE_MEMBER_ROLE,
 
     CREATE_VC, VC_INFO, EDIT_VC, DELETE_VC,
 
diff --git a/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java b/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
index 5aea201..e3454c6 100644
--- a/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
+++ b/src/main/java/de/ids_mannheim/korap/constant/PrivilegeType.java
@@ -10,7 +10,8 @@
 public enum PrivilegeType {
     READ_MEMBER, 
     WRITE_MEMBER, 
-    DELETE_MEMBER, 
+    DELETE_MEMBER,
+    DELETE_SELF,
     SHARE_QUERY,
     DELETE_QUERY,
     READ_QUERY,
diff --git a/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java b/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
index 5026b6e..11e9c12 100644
--- a/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
+++ b/src/main/java/de/ids_mannheim/korap/service/UserGroupService.java
@@ -14,7 +14,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import de.ids_mannheim.korap.config.FullConfiguration;
 import de.ids_mannheim.korap.constant.PredefinedRole;
 import de.ids_mannheim.korap.constant.PrivilegeType;
 import de.ids_mannheim.korap.constant.UserGroupStatus;
@@ -62,10 +61,6 @@
     @Autowired
     private UserGroupConverter converter;
     @Autowired
-    private FullConfiguration config;
-    @Autowired
-    private MailService mailService;
-    @Autowired
     private RandomCodeGenerator random;
 
     /**
@@ -169,7 +164,7 @@
     
     private Set<Role> prepareMemberRoles (UserGroup userGroup) {
             Role r1 = new Role(PredefinedRole.GROUP_MEMBER,
-                    PrivilegeType.DELETE_MEMBER, userGroup);
+                    PrivilegeType.DELETE_SELF, userGroup);
             roleDao.addRole(r1);
             Set<Role>memberRoles = new HashSet<Role>();
             memberRoles.add(r1);
@@ -282,43 +277,6 @@
         return groupId;
     }
 
-    /**
-     * Adds a user to the specified usergroup. If the username with
-     * {@link GroupMemberStatus} DELETED exists as a member of the
-     * group,
-     * the entry will be deleted first, and a new entry will be added.
-     * 
-     * If a username with other statuses exists, a KustvaktException
-     * will
-     * be thrown.
-     * 
-     * @see GroupMemberStatus
-     * 
-     * @param username
-     *            a username
-     * @param userGroup
-     *            a user group
-     * @param createdBy
-     *            the user (query-access admin/system) adding the user
-     *            the user-group
-     * @param status
-     *            the status of the membership
-     * @throws KustvaktException
-     */
-    @Deprecated
-    public void inviteGroupMember (String username, UserGroup userGroup,
-            String createdBy)
-            throws KustvaktException {
-
-        addGroupMember(username, userGroup, createdBy,null);
-
-        if (config.isMailEnabled()
-                && userGroup.getStatus() != UserGroupStatus.HIDDEN) {
-            mailService.sendMemberInvitationNotification(username,
-                    userGroup.getName(), createdBy);
-        }
-    }
-
     public void addGroupMember (String username, UserGroup userGroup,
             String createdBy, Set<Role> roles)
             throws KustvaktException {
@@ -377,62 +335,6 @@
         return false;
     }
 
-    public boolean isUserGroupAdmin (UserGroupMember member)
-            throws KustvaktException {
-
-        for (Role r : member.getRoles()) {
-            if (r.getName().equals(PredefinedRole.GROUP_ADMIN)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    
-    /**
-     * Updates the {@link GroupMemberStatus} of a pending member
-     * to {@link GroupMemberStatus#ACTIVE} and add default member
-     * roles.
-     * 
-     * @param groupId
-     *            groupId
-     * @param username
-     *            the username of the group member
-     * @throws KustvaktException
-     */
-    @Deprecated
-    public void acceptInvitation (String groupName, String username)
-            throws KustvaktException {
-
-        ParameterChecker.checkStringValue(username, "userId");
-        ParameterChecker.checkStringValue(groupName, "groupName");
-
-        UserGroup userGroup = retrieveUserGroupByName(groupName);
-        UserGroupMember member = groupMemberDao.retrieveMemberById(username,
-                userGroup.getId());
-        // status pending
-//        else {
-//            if (DEBUG) {
-//                jlog.debug("status: " + member.getStatusDate());
-//            }
-//            ZonedDateTime expiration = member.getStatusDate().plusMinutes(30);
-//            ZonedDateTime now = ZonedDateTime.now();
-//            if (DEBUG) {
-//                jlog.debug("expiration: " + expiration + ", now: " + now);
-//            }
-//
-//            if (expiration.isAfter(now)) {
-//                member.setStatus(GroupMemberStatus.ACTIVE);
-                Set<Role> memberRoles = prepareMemberRoles(userGroup);
-                member.setRoles(memberRoles);
-                groupMemberDao.updateMember(member);
-//            }
-//            else {
-//                throw new KustvaktException(StatusCodes.INVITATION_EXPIRED);
-//            }
-//        }
-    }
-
     public boolean isMember (String username, UserGroup userGroup)
             throws KustvaktException {
         List<UserGroupMember> members = groupMemberDao
diff --git a/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java b/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
index c0325b8..881dbc9 100644
--- a/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
+++ b/src/main/java/de/ids_mannheim/korap/web/controller/UserGroupController.java
@@ -10,6 +10,7 @@
 import de.ids_mannheim.korap.constant.PredefinedRole;
 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.service.OAuth2ScopeService;
 import de.ids_mannheim.korap.security.context.TokenContext;
 import de.ids_mannheim.korap.service.UserGroupService;
@@ -201,6 +202,20 @@
      *            usernames separated by comma
      * @return if successful, HTTP response status OK
      */
+    @Deprecated
+    @POST
+    @Path("@{groupName}/invite")
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    public Response inviteGroupMembers (
+            @Context SecurityContext securityContext,
+            @PathParam("groupName") String groupName,
+            @FormParam("members") String members) {
+        throw kustvaktResponseHandler.throwit(new KustvaktException(
+                StatusCodes.DEPRECATED,
+                "This web-service is deprecated and will be completely removed "
+                + "in API v1.1."));
+    }
+    
     @PUT
     @Path("@{groupName}/member")
     @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@@ -214,12 +229,39 @@
             scopeService.verifyScope(context,
                     OAuth2Scope.ADD_USER_GROUP_MEMBER);
             service.addGroupMembers(groupName, members, context.getUsername());
-            return Response.ok("SUCCESS").build();
+            return Response.ok().build();
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
         }
     }
+    
+    /**
+     * Adds roles of an active member of a user-group. Only user-group
+     * admins and system admins are allowed.
+     * 
+     * @param securityContext
+     * @param groupName
+     *            a group name
+     * @param memberUsername
+     *            a username of a group member
+     * @param roleId
+     *            a role id or multiple role ids
+     * @return if successful, HTTP response status OK
+     */
+    @Deprecated
+    @POST
+    @Path("@{groupName}/role/add")
+    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
+    public Response addMemberRoles (@Context SecurityContext securityContext,
+            @PathParam("groupName") String groupName,
+            @FormParam("memberUsername") String memberUsername,
+            @FormParam("roleId") List<Integer> roleIds) {
+        throw kustvaktResponseHandler.throwit(new KustvaktException(
+                StatusCodes.DEPRECATED,
+                "This web-service is deprecated and will be completely removed "
+                + "in API v1.1."));
+    }
 
     /**Add group admin role to a member in a group 
      * 
@@ -240,10 +282,10 @@
                 .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
-                    OAuth2Scope.ADD_USER_GROUP_MEMBER_ROLE);
+                    OAuth2Scope.ADD_MEMBER_ROLE);
             service.addAdminRole(context.getUsername(), groupName,
                     memberUsername);
-            return Response.ok("SUCCESS").build();
+            return Response.ok().build();
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -270,15 +312,24 @@
     public Response deleteMemberRoles (@Context SecurityContext securityContext,
             @PathParam("groupName") String groupName,
             @FormParam("memberUsername") String memberUsername,
+            @FormParam("roleId") List<Integer> roleIds,
             @FormParam("role") List<PredefinedRole> roles) {
         TokenContext context = (TokenContext) securityContext
                 .getUserPrincipal();
         try {
             scopeService.verifyScope(context,
-                    OAuth2Scope.DELETE_USER_GROUP_MEMBER_ROLE);
-            service.deleteMemberRoles(context.getUsername(), groupName,
-                    memberUsername, roles);
-            return Response.ok("SUCCESS").build();
+                    OAuth2Scope.DELETE_MEMBER_ROLE);
+            if (roleIds != null && !roleIds.isEmpty()){
+                throw kustvaktResponseHandler.throwit(new KustvaktException(
+                        StatusCodes.DEPRECATED,
+                        "Parameter roleIds is deprecated and will be completely"
+                        + " removed in API v1.1."));
+            }
+            else {
+                service.deleteMemberRoles(context.getUsername(), groupName,
+                        memberUsername, roles);
+            }
+            return Response.ok().build();
         }
         catch (KustvaktException e) {
             throw kustvaktResponseHandler.throwit(e);
@@ -299,17 +350,10 @@
     @Path("@{groupName}/subscribe")
     public Response subscribeToGroup (@Context SecurityContext securityContext,
             @PathParam("groupName") String groupName) {
-        TokenContext context = (TokenContext) securityContext
-                .getUserPrincipal();
-        try {
-            scopeService.verifyScope(context,
-                    OAuth2Scope.ADD_USER_GROUP_MEMBER);
-            service.acceptInvitation(groupName, context.getUsername());
-            return Response.ok("SUCCESS").build();
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
+        throw kustvaktResponseHandler.throwit(new KustvaktException(
+                StatusCodes.DEPRECATED,
+                "This web-service is deprecated and will be completely removed "
+                + "in API v1.1."));
     }
 
     /**
@@ -329,17 +373,9 @@
     public Response unsubscribeFromGroup (
             @Context SecurityContext securityContext,
             @PathParam("groupName") String groupName) {
-        TokenContext context = (TokenContext) securityContext
-                .getUserPrincipal();
-        try {
-            scopeService.verifyScope(context,
-                    OAuth2Scope.DELETE_USER_GROUP_MEMBER);
-            service.deleteGroupMember(context.getUsername(), groupName,
-                    context.getUsername());
-            return Response.ok("SUCCESS").build();
-        }
-        catch (KustvaktException e) {
-            throw kustvaktResponseHandler.throwit(e);
-        }
+        throw kustvaktResponseHandler.throwit(new KustvaktException(
+                StatusCodes.DEPRECATED,
+                "This web-service is deprecated and will be complete removed "
+                + "in API v1.1."));
     }
 }
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerTest.java
index 919c3c0..292c8e0 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupControllerTest.java
@@ -104,8 +104,6 @@
         testUpdateUserGroup(groupName);
         testAddMember(groupName, username, "darla");
         testDeleteGroup(groupName,username);
-//        testSubscribeToDeletedGroup(groupName);
-//        testUnsubscribeToDeletedGroup(groupName);
     }
     
     private void testUpdateUserGroup (String groupName)
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupTestBase.java b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupTestBase.java
index b8f3bc1..630ee66 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupTestBase.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/usergroup/UserGroupTestBase.java
@@ -73,25 +73,12 @@
         return response;
     }
     
-//    protected Response inviteMember (String groupName, String invitor,
-//            String invitee) throws KustvaktException {
-//        Form form = new Form();
-//        form.param("members", invitee);
-//        Response response = target().path(API_VERSION).path("group")
-//                .path("@" + groupName).path("invite").request()
-//                .header(HttpHeaders.X_FORWARDED_FOR, "149.27.0.32")
-//                .header(Attributes.AUTHORIZATION, HttpAuthorizationHandler
-//                        .createBasicAuthorizationHeaderValue(invitor, "pass"))
-//                .post(Entity.form(form));
-////        assertEquals(Status.OK.getStatusCode(), response.getStatus());
-//        return response;
-//    }
-    
     protected void testAddMember (String groupName, String username,
             String memberUsername)
             throws KustvaktException {
         Response response = addMember(groupName, memberUsername, username);
         assertEquals(Status.OK.getStatusCode(), response.getStatus());
+        
         // list group
         JsonNode node = listUserGroups(username);
         node = node.get(0);
diff --git a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
index 3f1c8c0..5a1b900 100644
--- a/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
+++ b/src/test/java/de/ids_mannheim/korap/web/controller/vc/VirtualCorpusSharingTest.java
@@ -301,7 +301,7 @@
         JsonNode node = listUserGroups(testUser).get(0);
         assertEquals(2, node.get("members").size());
         assertEquals(memberName, node.at("/members/1/userId").asText());
-        assertEquals(PrivilegeType.DELETE_MEMBER.name(),
+        assertEquals(PrivilegeType.DELETE_SELF.name(),
                 node.at("/members/1/privileges/0").asText());
     }
 
