add authDo method to api.js to make authenticated requests