connecting to server and displaying data