I've changed the API to implement JSON API Standard. I used ActiveModel Serializers to do that, but I didn't find the way to make the serializer to store nested relationships in objects. So, in commons_controller.rb, I add every relationship explicitly:
https://github.com/siwapp/siwapp/blob/master/app/controllers/api/v1/commons_controller.rb#L49
Look for a cleaner solution.