public static Device GetDeviceStatus(string deviceId)
        {
            string cacheLocation = "DeviceStatus." + deviceId;
            try
            {
                if (Photon.Services.Utilities.CacheManager.ValidatExistence(cacheLocation))
                {
                    return Photon.Services.Utilities.CacheManager.Get(cacheLocation) as Device;
                }
                else
                {
                    lock (syncRoot)
                    {
                        if (!Photon.Services.Utilities.CacheManager.ValidatExistence(cacheLocation))
                        {
                            PhotonRESTService service = new PhotonRESTService();

                            //Dictionary<string, string> additionalParameters = new Dictionary<string, string>();
                            //additionalParameters.Add("area_id", "1"); //World
                            //additionalParameters.Add("authorized", "yes"); //authorized

                            string json = service.GetJSON(deviceId);

                            Device device = Newtonsoft.Json.JsonConvert.DeserializeObject<Device>(json);
                            Photon.Services.Utilities.CacheManager.Add(cacheLocation, deviceId, 1);
                            return device;
                        }
                        else
                        {
                            return Photon.Services.Utilities.CacheManager.Get(cacheLocation) as Device;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                return new Device() { Connected = false };
            }
        }