separate the API stuff into a separate module
refactor browser app into a singel file