Validating user email ID during sign up
There's no need to use any sort of API or query. If you're goal is to validate email, it's built into Drupal's core account settings (Configuration > People > Account settings). Just make sure the Require e-mail verification... checkbox is ticked on the form page.