Fixed ajax call

initial AJAX call is made only once now. Working as intended, but
creating the <li> elements crashes the browser.