Trouble with Programmatically Updating Media URLS in API to Cloudfront domain URL

im gonna be honest ive just been winging it