Improve error handling

Change-Id: I1f54cf9cd4770d6602f70036cf0e27c9ede8c893
diff --git a/t/match_info.t b/t/match_info.t
index c07e7aa..bd9afe9 100644
--- a/t/match_info.t
+++ b/t/match_info.t
@@ -25,14 +25,14 @@
 $fake_backend->pattern->defaults->{app}->log($t->app->log);
 
 # Query passed
-$t->get_ok('/corpus2/WPD15/232/39681/p2133-2134?spans=false&foundry=*')
+$t->get_ok('/corpus/WPD15/232/39681/p2133-2134?spans=false&foundry=*')
   ->status_is(200)
   ->json_is('/textSigle', 'WPD15/232/39681')
   ->json_like('/snippet', qr!<span class=\"context-left\">!)
-  ->json_is('/X-cached', undef)
+  ->header_isnt('X-Kalamar-Cache', 'true')
   ;
 
-$t->get_ok('/corpus2/GOE/AGF/02286/p75682-75683')
+$t->get_ok('/corpus/GOE/AGF/02286/p75682-75683')
   ->status_is(200)
   ->json_is('/textSigle', 'GOE/AGF/02286')
   ->json_is('/title','Materialien zur Geschichte der Farbenlehre')
@@ -40,7 +40,7 @@
 
 # TODO:
 #   It's surprising, that it doesn't return a 404!
-$t->get_ok('/corpus2/notfound/X/X/p0-1')
+$t->get_ok('/corpus/notfound/X/X/p0-1')
   ->status_is(200)
   ->json_is('/textSigle', 'NOTFOUND/X/X')
   ->json_is('/corpusID', undef)
@@ -48,7 +48,7 @@
 
 # TODO:
 #   Should probably return a 500!
-$t->get_ok('/corpus2/fail/x/x/p0-0')
+$t->get_ok('/corpus/fail/x/x/p0-0')
   ->status_is(200)
   ->json_is('/notifications/0/0', 'error')
   ->json_is('/notifications/0/1', 'Unable to load query response from /home/ndiewald/Repositories/korap-git/Kalamar/t/fixtures/response_matchinfo_fail_x_x_p0-0.json')
@@ -56,7 +56,7 @@
 
 # TODO:
 #   Should probably return a 4xx!
-$t->get_ok('/corpus2/GOE/AGF/02286/p-2-0')
+$t->get_ok('/corpus/GOE/AGF/02286/p-2-0')
   ->status_is(200)
   ->json_is('/notifications/0/0', 'error')
   ->json_is('/notifications/0/1', '730: Invalid match identifier')
@@ -64,19 +64,19 @@
 
 # TODO:
 #   It's surprising, that it doesn't return a 404!
-$t->get_ok('/corpus2/notfound2/X/X/p0-1')
+$t->get_ok('/corpus/notfound2/X/X/p0-1')
   ->status_is(404)
   ->json_is('/notifications/0/0', 'error')
   ->json_is('/notifications/0/1', '404: Not Found')
   ;
 
-$t->get_ok('/corpus2/brokenerr/X/X/p0-1')
+$t->get_ok('/corpus/brokenerr/X/X/p0-1')
   ->status_is(409)
   ->json_is('/notifications/0/0', 'error')
   ->json_is('/notifications/0/1', 'Message structure failed')
   ;
 
-$t->get_ok('/corpus2/brokenwarn/X/X/p0-1')
+$t->get_ok('/corpus/brokenwarn/X/X/p0-1')
   ->status_is(200)
   ->json_is('/notifications/0/0', 'warning')
   ->json_is('/notifications/0/1', '1: Warning 1')
@@ -84,18 +84,18 @@
   ->json_is('/notifications/1/1', 'Message structure failed')
   ;
 
-$t->get_ok('/corpus2/brokenerr2/X/X/p0-1')
+$t->get_ok('/corpus/brokenerr2/X/X/p0-1')
   ->status_is(417)
   ->json_is('/notifications/0/0', 'error')
   ->json_is('/notifications/0/1', 'Message structure failed')
   ;
 
 # Get from cache
-$t->get_ok('/corpus2/WPD15/232/39681/p2133-2134?spans=false&foundry=*')
+$t->get_ok('/corpus/WPD15/232/39681/p2133-2134?spans=false&foundry=*')
   ->status_is(200)
   ->json_is('/textSigle', 'WPD15/232/39681')
   ->json_like('/snippet', qr!<span class=\"context-left\">!)
-  ->json_is('/X-cached', 1)
+  ->header_is('X-Kalamar-Cache', 'true')
   ;