try {
securityService.registerUser(request);
}
catch (UsernameExistsException e) {
return Response.status(Response.Status.CONFLICT)
.entity(new ErrorMessage("Username already exists")).build();
}
// Create link to self
URI selfUri = uriInfo.getAbsolutePathBuilder()
.path(request.getUsername())