broke logic out into api.rb and the MagicCard class