                         completionHandler(streams: streams, error: nil)
                         return
                     }
-                    let userInfo = [
-                        NSLocalizedDescriptionKey : String("Operation was unsuccessful."),
-                        NSLocalizedFailureReasonErrorKey: String("Could not parse channel data to NSDictionnary"),
-                        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("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 getGamesWithSearchTerm(term: String, offset : Int, limit : Int, completionHandler: (games: [TwitchGame]?, error: NSError?) -> ()) {
+                }
+                completionHandler(streams: nil, error: .JSONError)
+                return
+            }
+            else {
+                completionHandler(streams: nil, error: .URLError)
+                return
+            }
+        }
+    }
+    
+    static func getGamesWithSearchTerm(term: String, offset : Int, limit : Int, completionHandler: (games: [TwitchGame]?, error: TwitchError?) -> ()) {
         //First we build the url according to the game we desire to get infos
         let searchUrlString = "https://api.twitch.tv/kraken/search/games"
         

                                    }
                                    else {
                                        //Error with the .m3u8
                                        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
                                    }
                            }

                        return
                    }
                }
                completionHandler(games: nil, error: .JSONError)
                return
            }
            else {
                completionHandler(games: nil, error: .URLError)
                return
            }
        }
    }
    
    static func getTopStreamsForGameWithOffset(game : String, offset : Int, limit : Int, completionHandler: (streams: [TwitchStream]?, error: TwitchError?) -> ()) {
        //First we build the url according to the game we desire to get infos
        let streamsUrlString = "https://api.twitch.tv/kraken/streams"
        
