working api call for creating document