split code in some functions to reduce cyclomatic complexity
set CORS relates headers to avoid Cross Origin error with basket.js