Implementing client state handling and more general format for returning messages that includes data and channel info