/// <summary>
        /// Gets all packages.
        /// </summary>
        /// <param name="categoryId">The category identifier.</param>
        /// <param name="errorResponse">The error response.</param>
        /// <returns></returns>
        public IEnumerable <Package> GetAllPackages(int?categoryId, out string errorResponse)
        {
            errorResponse = string.Empty;
            var encodedOrganizationKey = StoreService.GetEncodedOrganizationKey();

            var resourcePath = string.Empty;
            Dictionary <string, List <string> > queryParameters = null;

            if (categoryId.HasValue)
            {
                resourcePath = $"Api/Packages/GetSummariesByCategory/{categoryId.Value}/{encodedOrganizationKey}";
            }
            else
            {
                resourcePath    = "Api/Promos";
                queryParameters = new Dictionary <string, List <string> >
                {
                    { "$expand", new List <string> {
                          "PrimaryCategory,SecondaryCategory,PackageTypeValue,Vendor,PackageIconBinaryFile"
                      } }
                };
            }

            // deserialize to list of packages
            var response    = ExecuteRestGetRequest <List <Package> >(resourcePath, queryParameters);
            var packageList = new List <Package>();

            if (response.ResponseStatus == ResponseStatus.Completed && response.Data != null)
            {
                packageList = response.Data;

                // If the key is null null out the price so it can't be installed.
                if (encodedOrganizationKey.IsNullOrWhiteSpace())
                {
                    foreach (var package in packageList)
                    {
                        if (!package.IsFree)
                        {
                            package.Price = null;
                        }
                    }
                }
            }
            else
            {
                errorResponse = response.ErrorMessage;
            }

            return(packageList);
        }