Fix function query processing on the service side.

Fix function query processing on the service side, in accordance with
the updated protocol.
Fix the client side.