changed order in which api and globals are included.