Fix request handler. Add callback functions.