Route API calls through main index.php

With this commit, all the main site traffic goes through the index.php
file. There may be some residual calls that link directly to lib/.
Sample Nginx configuration for Dandelion