Simplify and make API url available as a global var