Currently, a new deviceID is generated each time the script is loaded. It would be better to use a more stable deviceID, e.g. based on the MAC address of the machine's network card. This way we can cache the authentication data, to reduce the number of calls to authenticate.