Add missing quotes around API endpoint.
Add re-ordering to JS.