added socket API
major refactoring
connection info