document stats API