change api & command sending function