Implement Organizations API

I've implemented the organizations API according to #330.