added: pubsub function for API front-end