restructured to separate out UI functionality and backend metrics APIs