Refactored postHandler (and spec) to have a single error handling closure function thingy