Add function to close lightbox via API