simple API on Ruby on Rails (version 2)