Added code for uploading data to server.