fix invalid property access if api call fails