 updatePassword = (e) ->
-  $.ajax
-    url: "http://localhost:5000/api/v1/user/update_password"
-    method: "POST"
-    data: JSON.stringify ->
-      "current_password": $("#current-password").val(),
-      "new_password": $("#new-password").val(),
-      "new_password_confirmation": $("#new-password-confirmation").val()
-    contentType: "application/json"
-    dataType: "json"
-    error: (jqXHR, textStatus, errorThrown) ->
-      errMsg = JSON.parse(jqXHR.responseText)['message']
-			ga('send', 'event', 'Authentication', 'UpdatePassword', 'Failure::' + errMsg)
-      # apiNotify {"status": 0, "message": errMsg}, "/account"
-    success: (data, textStatus, jqXHR) ->
-      console.log(data)
-			ga('send', 'event', 'Authentication', 'UpdatePassword', 'Success')
-      # apiNotify {"status": 1, "message": "Your password has been successfully updated!"}, "/account"
+  data = {
+    "current_password": $("#current-password").val(),
+    "new_password": $("#new-password").val(),
+    "new_password_confirmation": $("#new-password-confirmation").val()
+  }
+  apiCall "POST", "http://localhost:5000/api/v1/user/update_password", data, 'Authentication', 'UpdatePassword'
+  .success (data) ->
+    apiNotify {"status": 1, "message": "Your password has been successfully updated!"}, "/account"
+  .error (jqXHR) ->
+    apiNotify {"status": 0, "message": jqXHR.responseJSON.message}, "/account"
 
 resetPassword = (e) ->
   e.preventDefault()
-  form = $("#password-reset-form").serializeObject()
-  form["reset-token"] = window.location.hash.substring(1)
-  apiCall "POST", "http://localhost:5000/api/v1/user/confirm_password_reset", form
+  data = {
+    "reset_token": window.location.hash.substring(1)
+    "new_password": $("#password-reset-form input[name=new-password]").val()
+    "new_password_confirmation": $("#password-reset-form input[name=new-password-confirmation")
+  }
+  apiCall "POST", "http://localhost:5000/api/v1/user/confirm_password_reset", data, 'Authentication', 'ResetPassword'
   .done (data) ->
     ga('send', 'event', 'Authentication', 'ResetPassword', 'Success')
-    apiNotify data, "/"
+    apiNotify {"status": 1, "message": "Your password has been reset"}, "/"
+  .error (jqXHR) ->
+    apiNotify {"status": 0, "message": jqXHR.responseJSON.message}
 
 disableAccount = (e) ->
   e.preventDefault()
-  confirmDialog("This will disable your account, drop you from your team, and prevent you from playing!", "Disable Account Confirmation", "Disable Account", "Cancel",
-  () ->
-    form = $("#disable-account-form").serializeObject()
-    apiCall "POST", "http://localhost:5000/api/v1/user/disable_account", form
-    .done (data) ->
-      ga('send', 'event', 'Authentication', 'DisableAccount', 'Success')
-      apiNotify data, "/")
+  confirmDialog "This will disable your account, drop you from your team, and prevent you from playing!", "Disable Account Confirmation", "Disable Account", "Cancel", () ->
+    data = {
+      "password": $("#disable-account-form input[name=current-password]").val()
+    }
+    apiCall "POST", "http://localhost:5000/api/v1/user/disable_account", data, 'Authentication', 'DisableAccount'
+    .success (data) ->
+      apiNotify {"status": 1, "message": "Your password has been disabled"}, "/"
+    .error (jqXHR) ->
+      apiNotify {"status": 0, "message": jqXHR.responseJSON.message}
 
 Input = ReactBootstrap.Input
 Row = ReactBootstrap.Row

    team_password: ""

  componentWillMount: ->
    apiCall "GET", "http://localhost:5000/api/v1/user/status"
    .done ((api) ->
      @setState update @state,
        user: $set: api.data
    ).bind this

    apiCall "GET", "http://localhost:5000/api/v1/team"
    .done ((api) ->
      @setState update @state,
        team: $set: api.data
    ).bind this

  onTeamRegistration: (e) ->

    else
      newpass = @state.team_password
      newpass_confirm = @state.confirm_team_password
      confirmDialog "This will change the password needed to join your team.", "Team Password Change Confirmation", "Confirm", "Cancel",
      () ->
        data = {"new_password": newpass, "new_password-confirmation": newpass_confirm}
        apiCall "POST", "http://localhost:5000/api/v1/team/update_password", data
        .success (data) ->
          apiNotify {"status": 0, "message": "Your team password has been successfully updated!"}, "/account"
        .error (jqXHR) ->
          apiNotify {"status": 0, "message": jqXHR.responseJSON.message}

  listMembers: () ->
    for member in @state.team["members"]
