Revert "Revert "Add not found and application error pages.""

This reverts commit 25e94ca03271217fa5806681307c1ba134c29c96.
Move 404 and 500 error middleware down