Got buy from bank working.

Also factored out some common structure in calls to the backend.