full working api for creating docs