Fix JSON validation for empty arrays

An empty array/object JSON response like [] or {} should be considered as valid JSON.