How do you handle rate-limiting and pagination when writing scripts that interact with third-party security tool APIs?