act on json appropriately