Twitch API help: Returning undefined

For some reason, when I call the twitch API, the first item I call each time I run my program returns a link which looks like https://api.twitch.tv/kraken/channels/undefined. All subsequent calls to the API during that run return an expected result, but for some reason the first one does not. It doesn’t matter what I put in the first slot, I always get this “undefined” URL. Of course I can add a nonsense streamer in the first slot and filter it out from the result, but that’s a work around, not a solution. Can anyone explain to me why this is happening?

Got it! thanks mate! Now I feel dumb for not catching that… :confused: