missing parameter and empty query catching. reorganized error displaying js