API: Return a 404 error when no director rule is matched