Remove globals from api loader