Added API response handling

-BgApiController now handles JSON message and error responses from the
API
-added the BgApiResult class to store results of API requests
-SubmitTransaction now returns BgApiResult object