Added collectionapi and implemented some very raw functionality for type checks etc