added anticipated JS API code
Merge pull request #1 from zzen/dreamcode

added anticipated JS API code