rename arrayToIndendArray() to indendArrayStructure()
try...catch the connect()
use $this->connect(), instead of BaseController->connect()
making abstration:making connect($targetAPI, $JSONRequest) from  connect()in BaseController