Updated the client api to use pub/sub.