change event dispacher to stack middleware
added Middleware class to send OPTIONS headers