Fixed bug in pubsub API setup