All call (broadcast, to individual nodes) would be made by each application via the Middleware.
Middleware intercepts each call and keeps a track of the current devices registered etc. Main reason is for cleaner code, reduce redundancy of code and primarily applications do not need to track the device type and other details while broadcasting messages or taking to a particular device