# Step 4: Connect to an API
Real-world applications do not live in isolation — they need APIs to talk to. Setup your app to talk to an API.
**Let's change our application to fetch the data from the API.**
```typescript
interface Todo {
title: string;
}
export class AppElement extends HTMLElement {
todos: Todo[] = [];
connectedCallback() {
this.innerHTML = `
`)
.join('');
}
}
```
!!!!!
Run "nx serve todos" and open http://localhost:4200. What do you see?
!!!!!
"the server responded with a status of 404 (Not Found)" in Console.
Blank screen.
Exception rendered on the screen.