Detect CORS support and adjust API