Use path-to-regex for api URL matching.  Move isApiRequest to api.js