fix bugs for returning json
fix bugs for returning json