fixed bug when API was initialised before its dependencies