Prepare JSON passing & get all device ids

Line too long.