added serialization and made an api from rails-api generator