Separate UI code from actions
Fix crash on simultaneous connections
Fix crash on HTTP 204