Adjustments for subdirectory serving
diff --git a/templates/doc/data/corpus.html.ep b/templates/doc/data/corpus.html.ep
new file mode 100644
index 0000000..17dbda0
--- /dev/null
+++ b/templates/doc/data/corpus.html.ep
@@ -0,0 +1,5 @@
+% layout 'main', title => 'KorAP: Corpora';
+
+<h2>Corpora</h2>
+
+%= doc_uc
diff --git a/templates/exception.html.ep b/templates/exception.html.ep
deleted file mode 100644
index 8d3e656..0000000
--- a/templates/exception.html.ep
+++ /dev/null
@@ -1 +0,0 @@
-% notify('error' => '500: Server Error');
diff --git a/templates/exception.production.html.ep b/templates/exception.production.html.ep
new file mode 100644
index 0000000..7d8af3b
--- /dev/null
+++ b/templates/exception.production.html.ep
@@ -0,0 +1,6 @@
+% my $msg = $exception->message // '500: Internal Server Error';
+% layout 'main', title => 'KorAP: ' . $msg;
+
+<p id="no-results"><%= $msg  %></p>
+
+% notify('error' => $msg);
diff --git a/templates/layouts/main.html.ep b/templates/layouts/main.html.ep
index cb72f8a..6280855 100644
--- a/templates/layouts/main.html.ep
+++ b/templates/layouts/main.html.ep
@@ -6,7 +6,6 @@
     <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=false, user-scalable=no" />
     <link href="/img/favicon.ico" rel="shortcut icon" type="image/x-icon" /> 
     <link href="/css/kalamar-<%= $Kalamar::VERSION %>.css" type="text/css" rel="stylesheet" />
-    <script src="/js/<%== loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js') %>" type="text/javascript" async="async"></script>
   </head>
 % my $embedded = 0;
 % $embedded = 1 if stash('embedded');
@@ -33,13 +32,15 @@
       <a href="http://korap.ids-mannheim.de/"><%= loc 'about' %></a>
       <%= doc_link_to 'V '. $Kalamar::VERSION, 'korap', 'kalamar' %>
     </footer>
-    %= notifications 'Alertify', -no_include
     % };
+
+%= javascript '/js/' . loc('jsFile', 'kalamar-' . $Kalamar::VERSION . '-en.js')
 %= javascript begin  
   window.KorAP = window.KorAP || {};
   % my $api = url_for('index')->to_abs;
   % $api =~ s!/$!!;
   KorAP.URL = '<%== $api %>';
 % end
+%= notifications 'Alertify', -no_include
   </body>
 </html>
diff --git a/templates/not_found.production.html.ep b/templates/not_found.production.html.ep
new file mode 100644
index 0000000..ee74676
--- /dev/null
+++ b/templates/not_found.production.html.ep
@@ -0,0 +1,6 @@
+% my $msg = '404: Page not found';
+% layout 'main', title => 'KorAP: ' . $msg;
+
+<p id="no-results"><%= $msg %></p>
+
+% notify('warn' => $msg);