Check if API url exists

I have an API call that uses a dynamic URL. If the passed value doesn’t exist then I get a Page does not exist which breaks my server connect. Is there a way to check if an external file exists?

I solved this by unticking Pass Errors on the API call.