             self.updateUI(goaltype, timeBucketData: self.nogoArray)
 
         }
-        
-        GoalsRequestManager.sharedInstance.getGoalsOfType(goaltype , onCompletion: { (success, message, code, nil, goals, err) in
+    }
+    
+    private func callGoals(activities: [Activities]) {
+        print("****** GOALS CALLED ******")
+        Loader.Show(delegate: self)
+        GoalsRequestManager.sharedInstance.getAllTheGoals(activities) { (success, message, code, nil, goals, error) in
             if success {
+                Loader.Hide(self)
                 if let goalsUnwrap = goals {
-                        self.updateUI(goaltype, timeBucketData: goalsUnwrap)
+                    self.budgetArray = GoalsRequestManager.sharedInstance.sortGoalsIntoArray(GoalType.BudgetGoalString, goals: goalsUnwrap)
+                    self.timeBucketData(.BudgetGoalString)
+                    
+                    self.timeZoneArray = GoalsRequestManager.sharedInstance.sortGoalsIntoArray(GoalType.TimeZoneGoalString, goals: goalsUnwrap)
+                    self.timeBucketData(.TimeZoneGoalString)
+                    
+                    self.nogoArray = GoalsRequestManager.sharedInstance.sortGoalsIntoArray(GoalType.NoGoGoalString, goals: goalsUnwrap)
+                    self.timeBucketData(.NoGoGoalString)
                 }
             } else {
                 Loader.Hide(self)

        super.viewWillAppear(animated)
        
        self.callActivityCategory()
        setDeselectOtherCategory()

        self.timeBucketData(.BudgetGoalString)
        self.timeBucketData(.TimeZoneGoalString)
        self.timeBucketData(.NoGoGoalString)

        if let tabName = getViewControllerToDisplay(YonaConstants.nsUserDefaultsKeys.timeBucketTabToDisplay) as? String {
            switch tabName {

    }
    
    private func updateUI(goal: GoalType, timeBucketData: [Goal]) {
        
       let arrayData = timeBucketData.sort { $0.GoalName < $1.GoalName }
        switch goal {
        case .BudgetGoalString:
