Takes JSON and determines what command to send