Good job! Glad to see you got it working. Just a couple of notes:
- The API response will already be ordered by number of viewers, so you can just select the first element in the array
- You check for
stream == null, but I believe it can also just be an empty array? Maybe this is type coercion saving you here. I wouldn’t recommend relying on it. - There’s no need to iterate over the fallback API response either. Just select the first element.