Finished registration and login functionality