updates to api_query classes to write response to database. updates to schema to account for expanded classes