Update pathing and abstract out ajax calls