document counter api