Add function to delete the extra records in CouchDB