Add schema validation to measurements API.