Set argument as optional to match method signature

The 3rd argument causes error, not sure if is the signature has changed, now its working good.
Also updated deprecated JSON method to new one.