* refactor: split logic for building API config into public func * refactor: move config code out of internal/