added card controller functionality and database updates