title: Build many websites based in a single RESTful API, how should I do?
body: <p>I'm building a RESTful API (in PHP using <a href="http://luracast.com/products/restler/" rel="nofollow noreferrer">Restler Framework v3.0</a>) and I'm so confusing about what are the best pratices of how to use it.</p>
  <p>I want to use the Rest API to authenticate users in more than one domain (same users, many domains) and get some &quot;global&quot; info (eg.: latest blog posts), but I have this questions.</p>
  <h3>My Questions:</h3>
  <ol>
  <li>Should I use REST instead of database queries?</li>
  <li>Should I use the API only for XHR requests?</li>
  </ol>
  <hr />
  <p><strong>EDIT:</strong> I found <a href="https://stackoverflow.com/questions/4689060/using-a-restful-api-for-dynamic-websites">this question</a> that is like mine.</p>
  <p>I want to build websites using the same users, get &quot;latest posts&quot;, etc... If I make the REST API I could use it to get the users instead of querying database and duplicating code.</p>