Refactoring Scala ID API client in progress

Introduce client-specific Error type that can deal with API error
responses and http exceptions.

Split ID-specific API code from the general API interface.