move APIclient loading funcitons into a separate class, rename some funcitons for clarity