API - total_balance calculation incorrect - includes flex

When calling GET /balance?account_id=$account_id the total_balance includes my flex balance but its added to the balance rather than removed.

i.e.
If I have a balance of 5000 and a flex balance of 1000, my total balance should be 4000 however the API would return my balance is 6000.