Add tests for API links feature

This also fixes a bug I found while writing the tests (yes yes, I should
have just written them in the first place) with generating html_url's
for records that don't have a slug. If there is no slug on a record then
it's not currently possible to create an html_url.