This is a very small example app showing how to accept and return JSON as an API. An app like this could serve as a back end for a mobile app or a Backbone app, or any other web interface that relies on AJAX requests to view and change data.
If you're new to Sinatra I'd recommend starting with my Sinatra Heroku Template repository.