Added a callback based query method as well as the event emitter approach