Shutdown API.
Merge pull request #159 from square/dimitris/shutdown

Shutdown API.