FIX rawQueries. Improve to support success handler and failure handler