implemented the TODO's in UserController