WIP websockets.Added new state. Added logic for retrieve selected. Migrated code to module api