almost done with json api.