Initial API implementation
Still to do: check parameters are within valid ranges, catch ValueErrors during
prediction and raise API Exception, tidy up run_prediction.