Add documentation and fix refreshing token