controller and endpoint setup