Implemented server-side registration and login (not finished yet)