added support for class controllers when defining routes