migrate old ajax call to the new JCR rest API, also complete the jcr rest utils with some javascript utils function.