fix CORS
fix scan and initialize indexes