updated the api functions