edited product index if statement if api fails to load