added query/response serialization function definitions