Added functions to send the data to server