Loop Through Json Array Javascript Function Call