code: protected function doRecordSave(RecordInterface $record, bool $isCreation): ?Response {
          if ($isCreation) {
              $record->save(['*'], true);
          } else {
              $record->commit(['*'], true);
          }
          return null;
      }
docs: You may return instance of Response to immediately finish request (for example when validation error happens)
  @param RecordInterface $record
  @param bool $isCreation
  @return null|Response