Implement the JWT Bearer flow with a Salesforce Connected app...
Refactoring Apex and building flows...
Writing the API implementation...