Improved error page and fixed req.wantsJSON (also added req.explictlyAcceptsHTML)