Modify api_controller and user model
Modify api_controller to single line
Combine condition to single line