Convert payloads to JSON object before sending to client.