Seperate out activity view model, clean up server side code and update ui.