REST API: Use set_url_scheme.

Use set_url_scheme instead of doing it manually. props @georgestephanis