diff --git a/composer.json b/composer.json
index c81c3f702..10527f74e 100644
--- a/composer.json
+++ b/composer.json
@@ -67,7 +67,7 @@
     },
     "autoload-dev": {
         "psr-4": {
-            "tests\\": "tests/"
+            "Tests\\": "tests/"
         }
     },
     "scripts": {
diff --git a/phpunit.yml b/phpunit.yml
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/Api/Handler/IlluminateValidationExceptionHandler.php b/src/Api/Handler/IlluminateValidationExceptionHandler.php
index c25def581..743b4ca78 100644
--- a/src/Api/Handler/IlluminateValidationExceptionHandler.php
+++ b/src/Api/Handler/IlluminateValidationExceptionHandler.php
@@ -31,8 +31,17 @@ class IlluminateValidationExceptionHandler implements ExceptionHandlerInterface
     public function handle(Exception $e)
     {
         $status = 422;
+        $errors = $this->formatErrors($e->errors()->toArray());
 
-        $errors = $e->errors()->toArray();
+        return new ResponseBag($status, $errors);
+    }
+
+    /**
+     * @param array $errors
+     * @return array
+     */
+    protected function formatErrors(array $errors)
+    {
         $errors = array_map(function ($field, $messages) {
             return [
                 'detail' => implode("\n", $messages),
@@ -40,6 +49,6 @@ class IlluminateValidationExceptionHandler implements ExceptionHandlerInterface
             ];
         }, array_keys($errors), $errors);
 
-        return new ResponseBag($status, $errors);
+        return $errors;
     }
 }
diff --git a/tests/Flarum/Admin/Middleware/RequireAdministrateAbilityTest.php b/tests/Flarum/Admin/Middleware/RequireAdministrateAbilityTest.php
index 607000928..6dfaf84aa 100644
--- a/tests/Flarum/Admin/Middleware/RequireAdministrateAbilityTest.php
+++ b/tests/Flarum/Admin/Middleware/RequireAdministrateAbilityTest.php
@@ -1,15 +1,14 @@
 <?php
-namespace tests\Flarum\Admin\Middleware;
+namespace Tests\Flarum\Admin\Middleware;
 
 use Flarum\Admin\Middleware\AuthenticateWithCookie;
 use Flarum\Admin\Middleware\RequireAdministrateAbility;
 use Flarum\Core\Access\Gate;
 use Flarum\Core\Exception\PermissionDeniedException;
-use Illuminate\Contracts\Container\Container;
 use Mockery as m;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Http\Message\ServerRequestInterface;
-use tests\Test\TestCase;
+use Tests\Test\TestCase;
 
 class RequireAdministrateAbilityTest extends TestCase
 {
diff --git a/tests/Flarum/Api/Handler/FloodingExceptionHandlerTest.php b/tests/Flarum/Api/Handler/FloodingExceptionHandlerTest.php
new file mode 100644
index 000000000..fae69cc00
--- /dev/null
+++ b/tests/Flarum/Api/Handler/FloodingExceptionHandlerTest.php
@@ -0,0 +1,30 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\FloodingExceptionHandler;
+use Flarum\Core\Exception\FloodingException;
+use Tests\Test\TestCase;
+
+class FloodingExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new FloodingExceptionHandler;
+    }
+
+    public function test_it_handles_recognisable_exceptions()
+    {
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages(new FloodingException));
+    }
+
+    public function test_it_provides_expected_output()
+    {
+        $result = $this->handler->handle(new FloodingException);
+
+        $this->assertEquals(429, $result->getStatus());
+        $this->assertEquals([[]], $result->getErrors());
+    }
+}
diff --git a/tests/Flarum/Api/Handler/IlluminateValidationExceptionHandlerTest.php b/tests/Flarum/Api/Handler/IlluminateValidationExceptionHandlerTest.php
new file mode 100644
index 000000000..dac27528d
--- /dev/null
+++ b/tests/Flarum/Api/Handler/IlluminateValidationExceptionHandlerTest.php
@@ -0,0 +1,35 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\ValidationExceptionHandler;
+use Flarum\Core\Exception\ValidationException;
+use Tests\Test\TestCase;
+
+class IlluminateValidationExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new ValidationExceptionHandler;
+    }
+
+    public function test_it_handles_familiar_exceptions()
+    {
+        $validException = new ValidationException(['messages']);
+
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages($validException));
+    }
+
+    public function test_it_creates_the_desired_output()
+    {
+        $this->markTestIncomplete();
+
+        $exception = new ValidationException(['field' => ['Some error']]);
+
+        $response = $this->handler->handle($exception);
+
+        $this->assertEquals(422, $response->getStatus());
+    }
+}
diff --git a/tests/Flarum/Api/Handler/InvalidConfirmationTokenExceptionHandlerTest.php b/tests/Flarum/Api/Handler/InvalidConfirmationTokenExceptionHandlerTest.php
new file mode 100644
index 000000000..0951581c2
--- /dev/null
+++ b/tests/Flarum/Api/Handler/InvalidConfirmationTokenExceptionHandlerTest.php
@@ -0,0 +1,30 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\InvalidConfirmationTokenExceptionHandler;
+use Flarum\Core\Exception\InvalidConfirmationTokenException;
+use Tests\Test\TestCase;
+
+class InvalidConfirmationTokenExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new InvalidConfirmationTokenExceptionHandler;
+    }
+
+    public function test_it_handles_recognisable_exceptions()
+    {
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages(new InvalidConfirmationTokenException));
+    }
+
+    public function test_output()
+    {
+        $response = $this->handler->handle(new InvalidConfirmationTokenException);
+
+        $this->assertEquals(403, $response->getStatus());
+        $this->assertEquals([['code' => 'invalid_confirmation_token']], $response->getErrors());
+    }
+}
diff --git a/tests/Flarum/Api/Handler/ModelNotFoundExceptionHandlerTest.php b/tests/Flarum/Api/Handler/ModelNotFoundExceptionHandlerTest.php
new file mode 100644
index 000000000..7f173a144
--- /dev/null
+++ b/tests/Flarum/Api/Handler/ModelNotFoundExceptionHandlerTest.php
@@ -0,0 +1,30 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\ModelNotFoundExceptionHandler;
+use Illuminate\Database\Eloquent\ModelNotFoundException;
+use Tests\Test\TestCase;
+
+class ModelNotFoundExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new ModelNotFoundExceptionHandler;
+    }
+
+    public function test_it_handles_recognisable_exceptions()
+    {
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages(new ModelNotFoundException));
+    }
+
+    public function test_managing_exceptions()
+    {
+        $response = $this->handler->handle(new ModelNotFoundException);
+
+        $this->assertEquals(404, $response->getStatus());
+        $this->assertEquals([[]], $response->getErrors());
+    }
+}
diff --git a/tests/Flarum/Api/Handler/PermissionDeniedExceptionHandlerTest.php b/tests/Flarum/Api/Handler/PermissionDeniedExceptionHandlerTest.php
new file mode 100644
index 000000000..0b644a089
--- /dev/null
+++ b/tests/Flarum/Api/Handler/PermissionDeniedExceptionHandlerTest.php
@@ -0,0 +1,30 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\PermissionDeniedExceptionHandler;
+use Flarum\Core\Exception\PermissionDeniedException;
+use Tests\Test\TestCase;
+
+class PermissionDeniedExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new PermissionDeniedExceptionHandler;
+    }
+
+    public function test_it_handles_recognisable_exceptions()
+    {
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages(new PermissionDeniedException));
+    }
+
+    public function test_managing_exceptions()
+    {
+        $response = $this->handler->handle(new PermissionDeniedException);
+
+        $this->assertEquals(401, $response->getStatus());
+        $this->assertEquals([[]], $response->getErrors());
+    }
+}
diff --git a/tests/Flarum/Api/Handler/ValidationExceptionHandlerTest.php b/tests/Flarum/Api/Handler/ValidationExceptionHandlerTest.php
new file mode 100644
index 000000000..22d9c78a7
--- /dev/null
+++ b/tests/Flarum/Api/Handler/ValidationExceptionHandlerTest.php
@@ -0,0 +1,30 @@
+<?php
+namespace Tests\Flarum\Api\Handler;
+
+use Flarum\Api\Handler\ValidationExceptionHandler;
+use Flarum\Core\Exception\ValidationException;
+use Tests\Test\TestCase;
+
+class ValidationExceptionHandlerTest extends TestCase
+{
+    private $handler;
+
+    public function init()
+    {
+        $this->handler = new ValidationExceptionHandler;
+    }
+
+    public function test_it_handles_recognisable_exceptions()
+    {
+        $this->assertFalse($this->handler->manages(new \Exception));
+        $this->assertTrue($this->handler->manages(new ValidationException([])));
+    }
+
+    public function test_managing_exceptions()
+    {
+        $response = $this->handler->handle(new ValidationException(['There was an error']));
+
+        $this->assertEquals(422, $response->getStatus());
+        $this->assertEquals([['source' => ['pointer' => '/data/attributes/0'], 'detail' => 'There was an error']], $response->getErrors());
+    }
+}
diff --git a/tests/Flarum/Core/Settings/DatabaseSettingsRepositoryTest.php b/tests/Flarum/Core/Settings/DatabaseSettingsRepositoryTest.php
index 3e7929dc1..74e0b3dbd 100644
--- a/tests/Flarum/Core/Settings/DatabaseSettingsRepositoryTest.php
+++ b/tests/Flarum/Core/Settings/DatabaseSettingsRepositoryTest.php
@@ -1,10 +1,10 @@
 <?php
-namespace tests\Flarum\Core\Settings;
+namespace Tests\Flarum\Core\Settings;
 
 use Flarum\Settings\DatabaseSettingsRepository;
 use Illuminate\Database\ConnectionInterface;
 use Mockery as m;
-use tests\Test\TestCase;
+use Tests\Test\TestCase;
 
 class DatabaseSettingsRepositoryTest extends TestCase
 {
diff --git a/tests/Flarum/Core/Settings/MemoryCacheSettingsRepositoryTest.php b/tests/Flarum/Core/Settings/MemoryCacheSettingsRepositoryTest.php
index 125071278..0cd8ca7d6 100644
--- a/tests/Flarum/Core/Settings/MemoryCacheSettingsRepositoryTest.php
+++ b/tests/Flarum/Core/Settings/MemoryCacheSettingsRepositoryTest.php
@@ -1,10 +1,10 @@
 <?php
-namespace tests\Flarum\Core\Settings;
+namespace Tests\Flarum\Core\Settings;
 
 use Flarum\Settings\MemoryCacheSettingsRepository;
 use Flarum\Settings\SettingsRepositoryInterface;
 use Mockery as m;
-use tests\Test\TestCase;
+use Tests\Test\TestCase;
 
 class MemoryCacheSettingsRepositoryTest extends TestCase
 {
@@ -13,7 +13,7 @@ class MemoryCacheSettingsRepositoryTest extends TestCase
 
     public function init()
     {
-        $this->baseRepository = m::mock(\Flarum\Settings\SettingsRepositoryInterface::class);
+        $this->baseRepository = m::mock(SettingsRepositoryInterface::class);
         $this->repository = new MemoryCacheSettingsRepository($this->baseRepository);
     }
     
diff --git a/tests/Test/TestCase.php b/tests/Test/TestCase.php
index d91ad6f63..17bbc4a57 100644
--- a/tests/Test/TestCase.php
+++ b/tests/Test/TestCase.php
@@ -1,5 +1,5 @@
 <?php
-namespace tests\Test;
+namespace Tests\Test;
 
 use Mockery;
 use PHPUnit_Framework_TestCase;