added login functionality + register user on server-side