Got endpoint and javascript request working