Changed restfulController to convert arrays to json models