implemented api callbacks