I have seen many APIs set up where the user would send POST data to a JSON file. Take the Mandrill API for example:
The api is not really sending the post request to the json file, or to any file for that matter. It's just their api endpoint naming convention. The
/api/1.0/messages/send.json route is intercepted by the server app which process the post data.
If you check https://mandrillapp.com/api/docs/index.JSON.html the extension of the api route sets the output format.
So you can do: