Refactored some controllers to use the functionality from BaseApiController.