Update lib/api.xsjs fixes #19