changed connection to json