implemented api.publish

master