Changed card api to global vvariable to add efficiency to code