Add missing API endpoints and refactor

This fixes bugs and adds a bunch of missing endpoints, including
removing subscriptions (#5).