Initial validation and error handling