Refactoring the predictions REST calls