update socket functionality on server; emit socket events from users controller; cleanup syntax