Refactored code to use returnRequest.

Invalid parameters now uses returnRequest.