[FIX] Added back accound_ids for caching
[FIX] SQL string termination