Is it possible to have some urls routed to serve content and some to receive JSON in the same class?
This seems unlikely to me, the function signature doesn't provide a way to distinguish between REST and not.
I'm also not sure it is necessary, you can certainly have multiple class which provide REST and Web endpoints. You can even dynamically build routes within a route.