Added logic for signing out via api