LPS-47070 - apply promise pattern to JSONWS API javascript example template