Backbone code to work with the API collection in RoR