added a method to run queries

added runQuery method to run both executable and non-executable types
of queries