Correctly encode response for tracing