Switched to vanilla js and jquery, implemented ajax request