Fixed api function