Stellar and gas dynamics in galactic nuclei