Update code for device state APIs