HH-40443 add query params to POST request, fix several bugs, add tests