Started to implement error handling in the controllers.