Refactored API, returned back to event-based handlers. Upload and Websocket API simplified