Added schema validation code for incoming API data.