Catching .NET http client exception that gets thrown on 401 unauthorized access from server. On catching it on HTTP GET or POST, parse the response as message and throw an exception, to be caught and parsed as Error json object in main function.
The program now gets card balance using terminal API instead of cardholder API so that it gets only the card balances for the termina's location/business