Fix handleRequest type signature