Added Login implementation for client and server side