JavaScript API for Rest client