refactor send API