added optional format arg to areas where I thought it made sense (json
default, imo better choice than xml as default)