Updated API to support new idevices table
Updated table reference devices => idevices