Made it work with CORS headers