Add default encoder for error messages
Add support for custom init functions
Map server-sent events to JSON as EventSource can't specify accept