Add api.php support.  Fall back to web if not configured or if there is an error.