throw exceptions for validation errors
add tests for validation error handling