Using background thread for init/login/logout calls and added extra param check for init call.