added checks for json parameters, and minor param name changes.