To build a Rails application that will be an API server, you can start with a more limited subset of Rails in Rails 5.
To generate a new Rails API app:
rails new my_api --api
What --api does is to remove functionality that is not needed when building an API. This includes sessions, cookies, ass...