         }
     }
     
-    func getAssignments() -> [Assignment] {
-        return assignments
+    func fetchClasses() {
+        let credentialManager = CredentialManager.sharedInstance
+        if let (username, password) = credentialManager.getCredentials() {
+            let networkClient = NetworkClient(username: username, password: password)
+            networkClient.fetchPage(Page.Assignments,
+                successHandler: { (operation: AFHTTPRequestOperation!, response: AnyObject!) -> Void in
+                    let responseData = NSData(data: response as NSData)
+                    self.classes = Parser.parseClasses(responseData)
+                    NSNotificationCenter.defaultCenter().postNotificationName(Notification.classes.toRaw(), object: nil)
+                },
+                errorHandler: { (operation: AFHTTPRequestOperation!, error: NSError!) -> Void in
+                    NSLog("Error: \(error.description)")
+                    NSNotificationCenter.defaultCenter().postNotificationName(Notification.networkError.toRaw(), object: nil)
+                }
+            )
+        } else {
+            NSLog("Credentials were nil")
+        }
     }
-    
 }

private let _dataStore = DataStore()

enum Notification: String {
    case assignment = "DataStoreDidFinishLoadingAssignmentsNotification"
    case networkError = "DataStoreDidEncounterNetworkErrorNotification"
}

class DataStore {
    
    private var assignments: [Assignment] = []
    private var classes: [Class] = []
    
    class var sharedInstance: DataStore {
        return _dataStore
    }
    
    func getAssignments() -> [Assignment] {
        return assignments
    }
    
    func getClasses() -> [Class] {
        return classes
    }
    
    func fetchAssignments() {
