Prepare JSON passing & get all device ids

Agree, I'll do it later, for now it's a temporary not used code.