Refactor API to just have 3 functions