Prepare JSON passing & get all device ids

Since you copy-paste this try/catch a lot, maybe ```CallAndHandleExceptions(lambda);``` is a cleaner way?