udpated message api to send message to all devices or an array of devices or a specific device