this code should be made simpler to read
int result = checkForm(request);
if (result != 0)