commit api function