Add validation

Basic validation for API calls