Added a completion handler to queryAPIwithTerm:location: and added a dispatch_group to wait all asynchronous callbacks before exiting the program