protected virtual void SerializeData(HttpResponseBase response)
        {
            if (this.errorMessages.Any())
            {
                var originalData = this.Data;
                this.Data = new JsonResponse
                {
                    OriginalData  = originalData,
                    ErrorMessages = this.errorMessages
                };

                if (!response.IsError())
                {
                    response.StatusCode = (int)HttpStatusCode.BadRequest;
                }

                response.TrySkipIisCustomErrors = true;
            }

            var settings = new JsonSerializerSettings
            {
                ContractResolver  = new CamelCasePropertyNamesContractResolver(),
                Converters        = new JsonConverter[] { new StringEnumConverter() },
                NullValueHandling = NullValueHandling.Ignore,
            };

            var serializedData = JsonConvert.SerializeObject(this.Data, settings);

            response.Write(serializedData);
        }