modified the code to work with confluence API and not selenium