javascript check if json path exists