Added CORS, removed old public code