New user rest APIs

Very strongly recommend using moodle_major_version() instead of $CFG->version as this can expose the exact version of Moodle and then attackers can use known security issues to attack the site.