Add API endpoint tests.

Fixes #13.
Merge pull request #14 from one-love/issue/13

Add API endpoint tests.