Refactored the users controller to respond to JSON