diff --git a/app/users/controllers/user-accounts-controller.js b/app/users/controllers/user-accounts-controller.js
index 24a93cb..5f90844 100644
--- a/app/users/controllers/user-accounts-controller.js
+++ b/app/users/controllers/user-accounts-controller.js
@@ -10,58 +10,168 @@
   'use strict';
 
   angular.module('app.users').controller('userAccountsController', [
-    '$scope', '$window', 'APIUtils', 'dataService',
-    function($scope, $window, APIUtils, dataService) {
-      $scope.dataService = dataService;
+    '$scope', 'APIUtils',
+    function($scope, APIUtils) {
+      // TODO: Get the roles using Roles redfish URI.
+      $scope.roles = ['Administrator', 'Operator', 'User', 'Callback'];
       $scope.state = 'none';
-      $scope.errorMsg = '';
+      $scope.outMsg = '';
+      $scope.loading = true;
 
-      $scope.changePassword = function(
-          oldPassword, newPassword, confirmNewPassword) {
-        var user = $scope.dataService.getUser();
-        if (!oldPassword || !newPassword || !confirmNewPassword) {
-          $scope.state = 'error';
-          $scope.errorMsg = 'Field is required!';
-          return false;
-        }
-        if (newPassword !== confirmNewPassword) {
-          $scope.state = 'error';
-          $scope.errorMsg = 'New passwords do not match!';
-          return false;
-        }
-        if (newPassword === oldPassword) {
-          $scope.state = 'error';
-          $scope.errorMsg = 'New password and old password match!';
-          return false;
-        }
+      function loadUserInfo() {
+        $scope.users = [];
+        $scope.loading = true;
+        $scope.isUserSelected = false;
+        $scope.selectedUser = null;
 
-        // Verify the oldPassword is correct
-        dataService.ignoreHttpError = true;
-        APIUtils.testPassword(user, oldPassword)
+        APIUtils.getAllUserAccounts()
             .then(
-                function(state) {
-                  APIUtils.changePassword(user, newPassword)
-                      .then(
-                          function(response) {
-                            // Clear the textboxes on a success
-                            $scope.passwordVerify = '';
-                            $scope.password = '';
-                            $scope.oldPassword = '';
-                            $scope.state = 'success';
-                          },
-                          function(error) {
-                            $scope.state = 'error';
-                            $scope.errorMsg = 'Error changing password!';
-                          });
+                function(res) {
+                  $scope.users = res;
+                },
+                function(error) {
+                  console.log(JSON.stringify(error));
+                })
+            .finally(function() {
+              $scope.loading = false;
+            });
+      };
+      $scope.cancel = function() {
+        $scope.state = 'none';
+        $scope.outMsg = '';
+        loadUserInfo();
+      };
+      $scope.setSelectedUser = function(user) {
+        $scope.state = 'none';
+        $scope.outMsg = '';
+
+        $scope.isUserSelected = true;
+        $scope.selectedUser = angular.copy(user);
+        $scope.selectedUser.VerifyPassword = null;
+        // Used while renaming the user.
+        $scope.selectedUser.CurrentUserName = $scope.selectedUser.UserName;
+      };
+      $scope.createNewUser = function() {
+        $scope.state = 'none';
+        $scope.outMsg = '';
+
+        if (!$scope.selectedUser.UserName || !$scope.selectedUser.Password) {
+          $scope.state = 'error';
+          $scope.outMsg = 'Username or Password can\'t be empty';
+          return;
+        }
+        if ($scope.selectedUser.Password !==
+            $scope.selectedUser.VerifyPassword) {
+          $scope.state = 'error';
+          $scope.outMsg = 'Passwords do not match';
+          return;
+        }
+        var user = $scope.selectedUser.UserName;
+        var passwd = $scope.selectedUser.Password;
+        var role = $scope.selectedUser.RoleId;
+        var enabled = false;
+        if ($scope.selectedUser.Enabled != null) {
+          enabled = $scope.selectedUser.Enabled;
+        }
+
+        $scope.loading = true;
+        APIUtils.createUser(user, passwd, role, enabled)
+            .then(
+                function(response) {
+                  $scope.state = 'success';
+                  $scope.outMsg = 'User has been created successfully';
                 },
                 function(error) {
                   $scope.state = 'error';
-                  $scope.errorMsg = 'Old password is not correct!';
+                  if ((error.data.error['@Message.ExtendedInfo'] !=
+                       undefined) &&
+                      (error.data.error['@Message.ExtendedInfo'].length != 0)) {
+                    $scope.outMsg =
+                        error.data.error['@Message.ExtendedInfo'][0].Message;
+                  } else {
+                    $scope.outMsg = 'Failed to create new user.';
+                  }
                 })
             .finally(function() {
-              dataService.ignoreHttpError = false;
+              loadUserInfo();
+              $scope.loading = false;
             });
       };
+      $scope.updateUserInfo = function() {
+        $scope.state = 'none';
+        $scope.outMsg = '';
+        if ($scope.selectedUser.Password !==
+            $scope.selectedUser.VerifyPassword) {
+          $scope.state = 'error';
+          $scope.outMsg = 'Passwords do not match';
+          return;
+        }
+        var data = {};
+        if ($scope.selectedUser.UserName !==
+            $scope.selectedUser.CurrentUserName) {
+          data['UserName'] = $scope.selectedUser.UserName;
+        }
+        $scope.selectedUser.VerifyPassword = null;
+        if ($scope.selectedUser.Password != null) {
+          data['Password'] = $scope.selectedUser.Password;
+        }
+        data['RoleId'] = $scope.selectedUser.RoleId;
+        data['Enabled'] = $scope.selectedUser.Enabled;
+
+        $scope.loading = true;
+        APIUtils
+            .updateUser(
+                $scope.selectedUser.CurrentUserName, data['UserName'],
+                data['Password'], data['RoleId'], data['Enabled'])
+            .then(
+                function(response) {
+                  $scope.state = 'success';
+                  $scope.outMsg = 'User has been updated successfully';
+                },
+                function(error) {
+                  $scope.state = 'error';
+                  if ((error.data.error['@Message.ExtendedInfo'] !=
+                       undefined) &&
+                      (error.data.error['@Message.ExtendedInfo'].length != 0)) {
+                    $scope.outMsg =
+                        error.data.error['@Message.ExtendedInfo'][0].Message;
+                  } else {
+                    $scope.outMsg = 'Updating user failed.';
+                  }
+                })
+            .finally(function() {
+              loadUserInfo();
+              $scope.loading = false;
+            });
+      };
+      $scope.deleteUser = function(userName) {
+        $scope.state = 'none';
+        $scope.outMsg = '';
+
+        $scope.loading = true;
+        APIUtils.deleteUser(userName)
+            .then(
+                function(response) {
+                  $scope.state = 'success';
+                  $scope.outMsg = 'User has been deleted successfully';
+                },
+                function(error) {
+                  $scope.state = 'error';
+                  if ((error.data.error['@Message.ExtendedInfo'] !=
+                       undefined) &&
+                      (error.data.error['@Message.ExtendedInfo'].length != 0)) {
+                    $scope.outMsg =
+                        error.data.error['@Message.ExtendedInfo'][0].Message;
+                  } else {
+                    $scope.outMsg = 'Deleting user failed.';
+                  }
+                })
+            .finally(function() {
+              loadUserInfo();
+              $scope.loading = false;
+            });
+      };
+      loadUserInfo();
     }
   ]);
 })(angular);
