basic dynamic routing and error handling