Add json functions for legacy broswers