Only run Ajax call once in API