Fix api models and populate functions
Fix all chat and socket logic