extracted get_pull_requests method