Eigenseries solutions to optimal control problem and controllability problems on hyperbolic PDEs