Merge "Count error document to complete adding documents to the database." into nyc-dev