Implemented results API. Closes #395