Add a capabilities API call. Fixes #410.