Improved the put function
Test and set, preventing null value assignment if the json
body did not include the parameters.