Web api, sample js code