Changed the Ajax-calls to socketcalls