Added write functionality to server