Refactored query builder to throw damper exception for non existent queries