Refactored controllers to handle proper exception handling with JSON
Messages and HTTP response codes