title: Correct REST API semantics to check email exists or not
body: <p>I have an API that looks like <code>GET user/exists/by?email=&lt;email_here&gt;</code>.
  The objective of the API is to check if the email exists or not.</p>
  <p>I am confused over what should be the proper semantics of the API? Currently, I have 2 options.</p>
  <p>Option 1:
  Use HTTP status codes to drive the API.</p>
  <ul>
  <li>Send <code>204</code> if the email exists</li>
  <li>Send <code>404</code> if the email doesn't exist</li>
  <li>Send <code>400</code> if email fails validation</li>
  </ul>
  <p>Option 2:</p>
  <ul>
  <li>Send <code>200</code> with body <code>{&quot;exists&quot;: true}</code> when email exists</li>
  <li>Send <code>200</code> with body <code>{&quot;exists&quot;: false}</code> when email doesn't exists</li>
  <li>Send <code>400</code> if email fails validation</li>
  </ul>