Added invite functionality to back-end
+refactoring here and there..