Updated to work with the CORS-ready API