Create cardstream.class.php

adds a first draft of the generic api lib