[api] refactor the is_target_maintainer function