added very basic socket support for API server