Refactor Globals to API