optimized the folder fetch API