Add application entry point, add error and exception handling