Check mainTransform for undefined, not false
Check if resource exists
Merge pull request #81 from flyvictor/fix-POST-hooks-ordering

Check mainTransform for undefined, not false