fixed issues with json references being deallocated. need to fix libcurl memory leaks