An API for Distributed Machine Learning