wrap layer query if query wrapper available
Add empty guard for layer wrapper
Return wrapped layer query in the "query" attribure in the JSON representation