class SupervisorGroupAPIController {

    @RequestMapping(value = "/group/{groupId}/supervisor/save/{applyToAll}", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
    @ResponseBody
    public AcmGroup addSupervisorToGroup(@RequestBody AcmUser supervisor,
            @PathVariable("groupId") String groupId,
            @PathVariable("applyToAll") boolean applyToAll) throws AcmUserActionFailedException
    {
        groupId = new String(Base64.getUrlDecoder().decode(groupId.getBytes()));
        LOG.info("Saving supervisor to the group with ID = [{}]", groupId);
        return groupService.setSupervisor(supervisor, groupId, applyToAll);
    }

}