Added error handlers
Added real communication with server