model and controller for login and register