Adop api_entity to Rails 4