diff --git a/html/api_v0.php b/html/api_v0.php
index ffcd795b7e..a074169c3e 100644
--- a/html/api_v0.php
+++ b/html/api_v0.php
@@ -33,6 +33,10 @@ if (Config::get('api.cors.enabled') === true) {
require $config['install_dir'] . '/html/includes/api_functions.inc.php';
$app->setName('api');
+$app->notFound(function () use ($app) {
+ api_error(404, "This API route doesn't exist.");
+});
+
$app->group(
'/api',
function () use ($app) {