added retrieve and input json funcions