diff --git a/src/Form/JsonapiResourceConfigDeleteForm.php b/src/Form/JsonapiResourceConfigDeleteForm.php
index da42aa9..63a5142 100644
--- a/src/Form/JsonapiResourceConfigDeleteForm.php
+++ b/src/Form/JsonapiResourceConfigDeleteForm.php
@@ -37,7 +37,7 @@ class JsonapiResourceConfigDeleteForm extends EntityConfirmFormBase {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->entity->delete();
-    drupal_set_message($this->t('Resource %id has been reverted to default.', [
+    $this->messenger()->addStatus($this->t('Resource %id has been reverted to default.', [
       '%id' => $this->entity->id(),
     ]));
 
diff --git a/src/Form/JsonapiResourceConfigForm.php b/src/Form/JsonapiResourceConfigForm.php
index 7e18867..db7d26c 100644
--- a/src/Form/JsonapiResourceConfigForm.php
+++ b/src/Form/JsonapiResourceConfigForm.php
@@ -161,7 +161,7 @@ class JsonapiResourceConfigForm extends EntityForm {
       $existing_entity = $this->entityTypeManager
         ->getStorage('jsonapi_resource_config')->load($resource_config_id);
       if ($existing_entity && $entity->isNew()) {
-        drupal_set_message($this->t('This override already exists, please edit it instead.'));
+        $this->messenger()->addStatus($this->t('This override already exists, please edit it instead.'));
         return $form;
       }
       try {
@@ -206,17 +206,19 @@ class JsonapiResourceConfigForm extends EntityForm {
 
     switch ($status) {
       case SAVED_NEW:
-        drupal_set_message($this->t('Created the %label JSON:API Resource overwrites.', [
+        $this->messenger()->addStatus($this->t('Created the %label JSON:API Resource overwrites.', [
           '%label' => $resource_config->label(),
         ]));
         break;
 
       default:
-        drupal_set_message($this->t('Saved the %label JSON:API Resource overwrites.', [
+        $this->messenger()->addStatus($this->t('Saved the %label JSON:API Resource overwrites.', [
           '%label' => $resource_config->label(),
         ]));
     }
-    $form_state->setRedirectUrl($resource_config->urlInfo('collection'));
+    // TODO: Drupal Rector Notice: Please delete the following comment after you've made any necessary changes.
+    // Please confirm that `$resource_config` is an instance of `Drupal\Core\Entity\EntityInterface`. Only the method name and not the class name was checked for this replacement, so this may be a false positive.
+    $form_state->setRedirectUrl($resource_config->toUrl('collection'));
   }
 
   /**
