implement isOpen and isClosed

cc @dominictarr