Generic API controller for Rails models.