removed debug and added 404/500 handlers