Hook for custom body serialization

This should allow folks with legacy code that depend on a certain json format to use your software without major changes.