Adds use_sudo parameter to all relevant api functions
Make the hack less of a hack