Refactor to switch out api url on from domian