1) the general idea is that you send one request via APNS, and then respond with a command when the device is "home" to your MDM server. As soon as the device responds to your command, you can send another command in response, and so on, until the device executes all the commands to which your server should respond with an empty HTTP response.
2) It completely depends on your definition of the complex! Last year, I created 2 MDM servers, and this is not impossible, but rather difficult.
source share