The impact of ridesharing in mobility-on-demand systems