Deal with invalid requrst

refs #115, and show debug information on 404 page when environment is development.