Refactoring: use request object to handle unresolved paths + use JsonSetEncoder to help json lib encode JSON (STOX-10)