Implementing a startup controller on client side and a service to detect if we are offline or online