fixed response to json, still looping