For #3 and #4 added some checking of output from query provdier within wrapper