Minor nit fixes for api.js
Merge pull request #3810 from timvandermeij/nit-fixes

Minor nit fixes for api.js