Intelligent Middleware Infrastructure Aids Automated Demand Response