Generates promise chain to load API modules in sequence betfore everything else