Make api call protocol agnostic