typified the constructors for query/response; stubbed out encodeQuery