Your question is API Testing vs UI Testing. Take a moment with it on the right.
Talk me through your thinking if you like. When you're confident, submit your answer and I'll grade it like a real screen (7/10 or better passes).
How do you approach API testing versus UI testing?
Discuss what you would validate at each layer, how you would choose the appropriate layer for a test, and how the two approaches complement each other. Include examples of functional, negative, integration, regression, and smoke coverage, along with how you would handle test data and failures.