Allow frontend and backend to be run separately.

Add the 'check_online' method to check whether the backend is accessible
or not.
Reduce the wait for running threads timeout on quit.
Add retry feature to the backend requests send.