Added option to force JSON return