extract JsonHTTPRequest into its own lib