now doing all communcations from Connection calss in data.js.