if (xhr && xhr.responseText) {
          var data = $.parseJSON(xhr.responseText);
          $scope.error(`Error settings active state: ${data.errors[0]}`);
        } else {
          $scope.error(`Error settings active state: ${e}`);