Small, untested tweaks to Api.cs to hold DeviceID.