Wrote a core funciton to handle json api calls, and implemented the call to /account/balance.