example of encoding for a JSON object