added login functionality to the server side