added csv export functions and query-login function