parse request path and generate resp