Added json update function, currently no bugs