Filled out ServerAuthenticate functions

Login and register functions. Not sure if they are correct.