Set up a minimal development environment and write code that performs an HTTP GET to a given REST endpoint returning JSON. Parse the response and extract specified fields (e.g., order_id, courier_id, latitude, longitude, timestamp), handling authentication, pagination, rate limiting (e.g., backoff/retry), timeouts, and malformed records. Transform the data into a required schema and output it as CSV/JSON. Include basic unit tests and demonstrate error handling and logging.