Fix JSON validation for empty arrays

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