method for sending different data to server