Add json_encode to debug output