Update to work with new api method (api.addCommand)