added functions to login and register

also added event listeners for the forms