public List <string> GetStatesSearchByStreet(string street) { System.Threading.Thread.Sleep(2000); //rate limit if api is consumed free var response = SendRequest(street); return(response.Data == null || response.Data[0].Address == null || response.Data[0].Address.Count == 0? new List <string> { ErrorMessages.NoStateFound } : response.Data.SelectMany(x => x.Address).Select(y => y.ExtendedState).ToList() .Select(state => StateCodes.GetStateCode(state, _listOfStates)).ToList()); }