Make webpage reconnect to api on connection fail/disconnect.