Update api.rb

returns json with new=true/false and id always