prepare document for API