Added support for custom error response serializer.