add new public APIs for loading and applying env