Fix bug with called api method