class GroupRest {

    @PUT
    @Path("{groupTitle}/users")
    @RolesAllowed("admin")
    @ApiOperation("Add a Mobi User to a Group")
    public Response addGroupUser(@PathParam("groupTitle") String groupTitle, 
                                 @QueryParam("users") List<String> usernames) {
        if (StringUtils.isEmpty(groupTitle)) {
            throw ErrorUtils.sendError("Group title must be provided", Response.Status.BAD_REQUEST);
        }

        try {
            Group savedGroup = engineManager.retrieveGroup(rdfEngine.getEngineName(), groupTitle).orElseThrow(() ->
                    ErrorUtils.sendError("Group " + groupTitle + " not found", Response.Status.BAD_REQUEST));
            usernames.stream()
                    .map(username -> engineManager.retrieveUser(username).orElseThrow(() ->
                            ErrorUtils.sendError("User " + username + " not found", Response.Status.BAD_REQUEST)))
                    .forEach(savedGroup::addMember);
            engineManager.updateGroup(rdfEngine.getEngineName(), savedGroup);
            logger.info("Added user(s) " + String.join(", ", usernames) + " to group " + groupTitle);
            return Response.ok().build();
        } catch (IllegalArgumentException ex) {
            throw ErrorUtils.sendError(ex.getMessage(), Response.Status.BAD_REQUEST);
        }
    }

}