Handle errors with correct pages and codes

Resolves #164
Merge pull request #173 from theodi/fix-404-pages

Handle errors with correct pages and codes