Updated API, added QueryType feature.
Adapted changes to API updates.