changes in JS -   better handling of errors if server is not available