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