public ChallongeBracket CreateBracket(string name = null, BracketType bracketType = BracketType.DoubleElimination)
        {
            // Create url using Guid
            Regex  rgx = new Regex("[^a-zA-Z0-9 -]");
            Guid   g   = Guid.NewGuid();
            string url = Convert.ToBase64String(g.ToByteArray());

            url = rgx.Replace(url, "");

            // if name is null, name it with the guid
            if (name == null)
            {
                name = url;
            }

            RestRequest request = new RestRequest($"tournaments.json?tournament[name]={name}&tournament[tournament_type]={bracketType.ToRequestString()}&tournament[url]={url}", Method.POST);

            var bracketJson = m_client.Execute(request);

            if (bracketJson.ResponseStatus != ResponseStatus.Completed)
            {
                throw new Exception("Rest request failed. Try again.");
            }

            ChallongeBracket bracket = JsonConvert.DeserializeObject <BracketResponse>(bracketJson.Content).tournament;

            bracket.Started = false;
            return(bracket);
        }
        public ChallongeBracket FinalizeTournament(string tournamentId)
        {
            var request = new RestRequest($"tournaments/{tournamentId}/finalize.json?include_participants=1&include_matches=1", Method.POST);

            request.AddHeader("Accept", "application/json");
            var bracketJson = m_client.Execute(request);

            if (bracketJson.ResponseStatus != ResponseStatus.Completed)
            {
                throw new Exception("Rest request failed. Try again.");
            }

            ChallongeBracket bracket = JsonConvert.DeserializeObject <BracketResponse>(bracketJson.Content).tournament;

            //bracket.Initialize();
            return(bracket);
        }