diff --git a/src/Plugin/rest/resource/WebformElementsResource.php b/src/Plugin/rest/resource/WebformElementsResource.php
index 95dedcf..689f2a0 100644
--- a/src/Plugin/rest/resource/WebformElementsResource.php
+++ b/src/Plugin/rest/resource/WebformElementsResource.php
@@ -5,7 +5,8 @@ namespace Drupal\webform_rest\Plugin\rest\resource;
 use Drupal\webform\Entity\Webform;
 use Drupal\rest\Plugin\ResourceBase;
 use Drupal\rest\ModifiedResourceResponse;
-use Symfony\Component\HttpKernel\Exception\HttpException;
+use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Creates a resource for retrieving webform elements.
@@ -34,7 +35,7 @@ class WebformElementsResource extends ResourceBase {
    */
   public function get($webform_id) {
     if (empty($webform_id)) {
-      throw new HttpException(t("Webform ID wasn't provided"));
+      throw new BadRequestHttpException(t("Webform ID wasn't provided"));
     }
 
     // Load the webform.
@@ -50,7 +51,7 @@ class WebformElementsResource extends ResourceBase {
       return new ModifiedResourceResponse($form['elements']);
     }
 
-    throw new HttpException(t("Can't load webform."));
+    throw new NotFoundHttpException(t("Can't load webform."));
 
   }
 
diff --git a/src/Plugin/rest/resource/WebformSubmissionResource.php b/src/Plugin/rest/resource/WebformSubmissionResource.php
index dbad181..a242125 100644
--- a/src/Plugin/rest/resource/WebformSubmissionResource.php
+++ b/src/Plugin/rest/resource/WebformSubmissionResource.php
@@ -5,7 +5,7 @@ namespace Drupal\webform_rest\Plugin\rest\resource;
 use Drupal\webform\Entity\WebformSubmission;
 use Drupal\rest\Plugin\ResourceBase;
 use Drupal\rest\ModifiedResourceResponse;
-use Symfony\Component\HttpKernel\Exception\HttpException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 
 /**
  * Creates a resource for retrieving webform submission data.
@@ -64,7 +64,7 @@ class WebformSubmissionResource extends ResourceBase {
       return new ModifiedResourceResponse($response);
     }
 
-    throw new HttpException(t("Can't load webform submission."));
+    throw new NotFoundHttpException(t("Can't load webform submission."));
 
   }
 
