remove global API variable
add click handler for <a> elements
update styles