Fix NPE in QueryResource on bad query
Add simple unit tests for QueryResource
Merge pull request #988 from drcrallen/queryErrorFixer

Fix NPE in QueryResource on bad query