fix a few bugs by using a php json proxy