Split REST and socket logic into separate namespaces