Added API routes.

Also added a test script to lint on `npm test`.