Check for empty data before attempting JSON parsing on response