We need to update our implementation in `api/index.ts` to reflect our more complex services setup. There are some notes on this topic in this file:

=== NOTES

@import[../dev/SDK.md]

=== CODE

@cmd[cpai ../api ../services/pipeline ../services/state ../services/fs ../services/resolution --stdout]

=== YOUR TASK

Can you please make a plan for the specific changes needed to `api/index.ts` and `api/api.test.ts` in order to align with our more sophisticated services setup?
