Cards backend

Added initial function to select cards.