fix remote host in js
add all clause in rest handler