begin api refactor
refactor signature to use api functions