changed most of the ajax calls to use sockets