Refactored to remove duplication on function that sends messages to mongo

There was a long standing ToDo on mongo CRUD operations to send msg and check for writeconcern. Code added to remove duplication