Update error serialization and handle inner class deserialization

To make the output streaming of successful and failed responses more consistent, the message consumer now outputs errors into the response data buffer already serialized.