Refactor API and add is_authorized/0 fun