add if-else branches in client side in case server operation fails