move api helper methods to separate module