Energy Router for Optimizing Resources in a Demand Response Framework