I'm not sure I understand all your requirements, but it seems to me that they can be reduced to the following functionalities:

Request-reply interaction with the Client.
Responses which depend...