Merge pull request #2 from cvan/master

fix undefined `res` error
provide JSON output for reports