Modified WebHandler to use events