Fix using a function as request handler