added support for custom error pages

Closes #32