public IActionResult EndStream(string broadcasterName) { try { var stream = _streamService.GetStreams() .Single(s => s.Broadcaster.Username == broadcasterName); _streamService.EndStream(stream); return(Ok()); } catch (Exception e) { PrintException(e); return(BadRequest(new { message = e.Message })); } }