refactored queryAPI, added keywords