Added json response to purchases controller.