Controller instead of routes

Moving most of the code from the routes file to the UsersController