work on result queuing function
simplify by consolidating HTTP and WebSocket into one handler