Adding api hooks