adding json serialize to all json_encode
patching var URL issues