public HttpResponseMessage GetLocationByGuidAndId(Guid guid, int id)
        {
            var result       = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Client code does not have an active account");
            var clientEntity = _lookupService.GetClientByGuid(guid);

            if (clientEntity == null)
            {
                _log.Error(string.Format("Failed to lookup Client by GUID: {0}", guid));
            }
            else
            {
                var locationEntity = _lookupService.GetLocationByIdAndClientId(new List <string> {
                    clientEntity.Id.ToString()
                }, id);
                var location = new LocationDTO();
                if (locationEntity != null)
                {
                    location       = LocationMapper.ToDataTransferObject(locationEntity);
                    location.Areas = _lookupService.GetAreasByLocationId(location.Id).Select(x => AreaMapper.ToDataTransferObject(x)).ToList();
                }
                result = Request.CreateResponse(HttpStatusCode.OK, location);
            }
            result.Headers.Add("Access-Control-Allow-Origin", "*");
            return(result);
        }
        public HttpResponseMessage GetClientByGuid(Guid guid)
        {
            var result       = Request.CreateErrorResponse(HttpStatusCode.BadRequest, "Client code does not have an active account");
            var clientEntity = _lookupService.GetClientByGuid(guid);

            if (clientEntity == null)
            {
                _log.Error(string.Format("Failed to lookup Client by GUID: {0}", guid));
            }
            else
            {
                var client    = ClientMapper.ToDataTransferObject(clientEntity);
                var locations = _lookupService.GetLocationsByClientId(clientEntity.Id);
                if (locations != null && locations.Count() > 0)
                {
                    client.Locations = locations.Select(x => LocationMapper.ToDataTransferObject(x)).ToList();
                }
                result = Request.CreateResponse(HttpStatusCode.OK, client);
            }
            result.Headers.Add("Access-Control-Allow-Origin", "*");
            return(result);
        }