add user controller and bug fixes