Implemented API to trigger deploys.
Totally hacktastic and needs cleaning up and testing.