fix json code, we dont have async here.

Fix the async issue in non-async code and resolve de _on_clonnection_close problem.