finish all api functions