checking for null values in API