Implemented specs and better error handling of Xero integration