Again moved around get json data and call to pan, to try to avoid recursion