API Rails 4 compliant