added check for empty API return or API downtime