API validation and HTTP error status codes