I don't really like this function, but i couldn't find another way to pass the endPoint url to the model/APIClient