Implemented login, and some rest stuff