
You are right on the mark wanting to test as close to the code as you can. As far at building API tests, just like with UI tests it is generally good practice to build tests that can run independently of any other test. So if you need a particular piece of data, you want to build it in the test as setup, and then maybe delete it when the test is done.