adds checks for nil values returned from api search call