completes UI logic: controllers on the angularjs docs