Update api to allow output format as a per-request option