New Demand Response framework and its applications for electricity markets