Make nesting of queryLog consistent for success and failure responses.

Closes #234
Merge pull request #235 from FriendsOfCake/query-log

Make nesting of queryLog consistent for success and failure responses.