Removed functions from controllers and added to separate gameApi folder, also removed $scope from gameApi as it was breaking the angular