start of server side code for login process