Elation Health interview question

Interviewer asked to write a sample function to call an API, and a few open-ended questions on optimizing the process