added ws routes for functionality, TODO: implement them all, !invites!
extracted routing pieces of code into functions