Takes JSON and determines what command to send and where to send it