refactor api function variable names