Added custom exceptions and handlers