Finalized the API publishing logic