JS: Ajax Call to endpoint after page load