Issue#345 404

Fixes #345
Custom 404 and 500 handling