Prepare JSON passing & get all device ids

We should probably *not* throw from C++ into Java.

That said, an error on C++ side of parsing this JSON is something worth detecting on the Java side, I think. Totally fine if it happens in another PR, can merge this one in now.