Allow frontend and backend to be run separately.

Add the 'check_online' method to check whether the backend is accessible
or not.