updated API for pubSub