code: def merge_record_data(self, changes, orig_record=None):
          
          current_app.logger.info("Merging request data with db record")
          current_app.logger.debug("orig_record: {}".format(orig_record))
          current_app.logger.debug("Changes".format(changes))
          final_record = changes
          if request.method == 'PATCH':
              final_record = dict(orig_record)
              final_record.update(changes)
          elif request.method == 'PUT':
              if '_id' in orig_record:
                  final_record['_id'] = orig_record['_id']
          return final_record
docs: This method merges PATCH requests with the db record to ensure no
             data is lost. In addition, it is also a hook for other fields to
             be overwritten, to ensure immutable fields aren't changed by a
             request.