add custom exceptions and tests