register function on usersController handles the registration