Completed Error management. Refactored controllers.