again a bit of restructuring, ensuring API only exists once, popup references API instance created from background page, some UI tweaks