Refactored rest of controller.
Refactored TaskController.