Move else statements after right curly brace, return object instead of assigning to a variable and just returning the same variable, remove todo jautodocs comments, move comments before the code instead of at the end of the line, remove printstacktrace and change to log.error

GCP-10236

Reviewer: Crisjaira Villarino
Use single quote in string literals for js files, add curly braces to if else statements, add missing semicolns

GCP-10236

Reviewer: Crisjaira Villarino