Sending changes from javascript to server