Write a Python script to parse an API JSON response and validate specific nested fields.
Implement validate_api_response(json_response, expected_fields). The first argument is a JSON string, and the second is a dictionary mapping dot-delimited paths to expected values. Return True only when the JSON is valid and every expected field exists with the specified value. Return False for malformed JSON, missing paths, or mismatched values. Numeric path components address list elements, such as items.0.id.
json_response is a JSON string representing an object or array.expected_fields contains dot-delimited paths mapped to JSON-compatible expected values.False for malformed JSON, missing fields, invalid list indices, or mismatched values.def validate_api_response(json_response, expected_fields):