adding returns to statements that are sending errors

Need to add `return` to lines that are sending errors so that the code does not continue and also try to send a different response.