Fix validation checks in API.