Below is my code to call api and it returns Swift.Error when the api call has error.
AccountAPI.postAccount(withSignUpCommand: signUpCommand) .sin