Needs to happen before setup-endpoints