Refactor the login and csv export requests