What am is missing? (API CORS)

Thank you that helped me alot! But there was one more problem and that was the "'Authorization' => 'Basic ', $apiKey," part. I just needed a dot before $apiKey. Thanks again for your help!