API v2: update spec to plain JavaScript.