Middleware and functions to deal simply with client errors.
Merge pull request #3 from mdaley/master

Middleware and functions to deal simply with client errors.