added CORS and JSONP support for API calls