Fixed bugs in api call, html id conflicts, and javascript