don't re-add trailing slashes
added custom error handler

convert errors to exceptions