javascript implementation of the report APIs