Multistage Stochastic Optimization Under Exogenous And Endogenous Uncertainty