Registration and authorization via Ajax requests to RESTful API. Some changes in UsersController because of Ajax requests. Ajax requests can't interact with Play Framework without renderJSON (or I don't know the way).