socket and api fixed