Random backend buck fixes and refactoring related to login and registration.