Added missing to_json call to the code sample.