# How WebsiteController differs from AcronymsController

**URL:** <https://forums.kodeco.com/t/how-websitecontroller-differs-from-acronymscontroller/47684>\
**Category:** Server Side Swift with Vapor\
**Created:** [August 30, 2018, 3:41am UTC](https://forums.kodeco.com/t/how-websitecontroller-differs-from-acronymscontroller/47684 "2018-08-30T03:41:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![crystaltwix](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@crystaltwix](https://forums.kodeco.com/u/crystaltwix)\
**Post date:** [August 30, 2018, 3:41am UTC](https://forums.kodeco.com/t/how-websitecontroller-differs-from-acronymscontroller/47684/1 "2018-08-30T03:41:20Z")

</div>

I noticed that in AcronymsController we have a route like /api/acronyms, but then in WebsiteController, the paradigm is different. There’s no api in any of the URLs. Is that because we start with the /index page and everything is based off of that base route? So then we would hit /acronyms instead and show the View for that page? In other words, by using WebsiteController, there are two different ways of getting to the data, one being just API driven, the other being through rendering a page.

Lastly, if we were doing a Single Page App, it seems like then we would have our pages then make requests to the /api/acronyms instead right?

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [September 1, 2018, 6:14am UTC](https://forums.kodeco.com/t/how-websitecontroller-differs-from-acronymscontroller/47684/2 "2018-09-01T06:14:09Z")

</div>

@0xtim Can you please help with this when you get a chance? Thank you - much appreciated! :]

---

<div class="post-metadata">

**Author:** ![0xtim](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/0xtim/32/111111_2.png) [@0xtim](https://forums.kodeco.com/u/0xtim)\
**Post date:** [September 28, 2018, 4:14pm UTC](https://forums.kodeco.com/t/how-websitecontroller-differs-from-acronymscontroller/47684/3 "2018-09-28T16:14:54Z")

</div>

Hi @crystaltwix sorry it’s taken me so long to reply!

The reason for having `/api` in the routes for the controllers are to help differentiate the routes for returning JSON and returning HTML. If you didn’t have any of the Lea stuff you could remove `/api` if you wanted. And like you said, for the website, everything starts at the route path `/` so it makes sense to branch off from there.

If you are doing a single page app using React or similar, then yep everything just calls the API. They don’t even have to be the same app!
