added user controller; added login function to application controller