What are APIs and how would you fix different types of API issues, step by step?
Implement diagnose_api_issues(records, timeout_ms). Each record is a dictionary containing status, latency_ms, auth_valid, and body_valid. Return one dictionary per record with an issue category and an ordered list of remediation steps. Apply rules in this order: authentication, rate limiting, server failure, client failure, invalid response, timeout, then success. Each record must produce exactly one result.
def diagnose_api_issues(records, timeout_ms):