                         return
                     }
                 }
-                let userInfo = [
-                    NSLocalizedDescriptionKey : String("Operation was unsuccessful."),
-                    NSLocalizedFailureReasonErrorKey: String("Could not parse data to a valid NSDictionnary object"),
-                    NSLocalizedRecoverySuggestionErrorKey: String("Please ensure that the provided game is valid")
-                ]
-                completionHandler(streams: nil, error: NSError(domain: "TwitchAPI", code: 3, userInfo: userInfo))
-                return
-            }
-            else {
-                let userInfo = [
-                    NSLocalizedDescriptionKey : String("Operation was unsuccessful."),
-                    NSLocalizedFailureReasonErrorKey: String("The operation returned an error : %@", response.result.error.debugDescription),
-                    NSLocalizedRecoverySuggestionErrorKey: String("Please ensure that the provided channel is valid")
-                ]
-                completionHandler(streams: nil, error: NSError(domain: "TwitchAPI", code: 1, userInfo: userInfo))
-                return
-            }
-        }
-    }
-    
-    static func authenticate(withCode code: String, andUUID UUID: String, completionHandler: (token: String?, error: String?) -> ()) {
+                completionHandler(streams: nil, error: .JSONError)
+                return
+            }
+            else {
+                completionHandler(streams: nil, error: .URLError)
+                return
+            }
+        }
+    }
+    
+    static func getStreamsThatUserIsFollowing(offset : Int, limit : Int, completionHandler: (streams: [TwitchStream]?, error: TwitchError?) -> ()) {
+        
+        guard let token = TokenHelper.getTwitchToken() else {
+            completionHandler(streams: nil, error: .AuthError)
+            return
+        }
+        //First we build the url according to the game we desire to get infos
+        let streamsUrlString = "https://api.twitch.tv/kraken/streams/followed"
+        
+        Alamofire.request(.GET, streamsUrlString, parameters :
+            [   "limit"         : limit,
+                "offset"        : offset,
+                "oauth_token"   : token     ])
+            .responseJSON { response in
+                
+                if response.result.isSuccess {
+                    if let streamsInfoDict = response.result.value as? [String : AnyObject] {
+                        if let streamsDicts = streamsInfoDict["streams"] as? [[String : AnyObject]] {
+                            var streams = [TwitchStream]()
+                            for streamDict in streamsDicts {
+                                if let channelDict = streamDict["channel"] as? [String : AnyObject] {
+                                    if let channel = TwitchChannel(dict: channelDict), stream = TwitchStream(dict: streamDict, channel: channel) {
+                                        streams.append(stream)
+                                    }
+                                }
+                            }
+                            completionHandler(streams: streams, error: nil)
+                            return
+                        }
+                    }
+                    completionHandler(streams: nil, error: .JSONError)
+                    return
+                }
+                else {
+                    completionHandler(streams: nil, error: .URLError)
+                    return
+                }
+        }
+    }
+    
+    static func authenticate(withCode code: String, andUUID UUID: String, completionHandler: (token: String?, error: TwitchError?) -> ()) {
         let urlString = "http://streamcenterapp.com/oauth/twitch/\(UUID)/\(code)"
         Alamofire.request(.GET, urlString)
             .responseJSON { response in

                        return
                    }
                }
                let userInfo = [
                    NSLocalizedDescriptionKey : String("Operation was unsuccessful."),
                    NSLocalizedFailureReasonErrorKey: String("Could not parse data to a valid NSDictionnary object"),
                    NSLocalizedRecoverySuggestionErrorKey: String("Please ensure that the provided url is valid")
                ]
                completionHandler(games: nil, error: NSError(domain: "TwitchAPI", code: 3, userInfo: userInfo))
                return
            }
            else {
                let userInfo = [
                    NSLocalizedDescriptionKey : String("Operation was unsuccessful."),
                    NSLocalizedFailureReasonErrorKey: String("The operation returned an error : %@", response.result.error.debugDescription),
                    NSLocalizedRecoverySuggestionErrorKey: String("Please ensure that the provided channel is valid")
                ]
                completionHandler(games: nil, error: NSError(domain: "TwitchAPI", code: 1, userInfo: userInfo))
                return
            }
        }
    }
    
    static func getTopStreamsForGameWithOffset(game : String, offset : Int, limit : Int, completionHandler: (streams: [TwitchStream]?, error: NSError?) -> ()) {
        //First we build the url according to the game we desire to get infos
        let streamsUrlString = "https://api.twitch.tv/kraken/streams"
        

                        completionHandler(token: token, error: nil)
                    }
                } else {
                    completionHandler(token: nil, error: .URLError)
                    return
                }
                
