Finished commenting UI Sprint 2

Finished commenting UI sprint 2 and increasing the robustness of error
handling. Also added parameter checking.