building simple API with Ruby on Rails