Collections support

Adds support for retrieving and modifying collections via the API.