Refactoring. Move some code from ApiManager to models. Move loading image from controller to ApiManager.