fix syntax errors in request handler