Added returnRequest. Used returnCode values.

Added returnRequest. Used returnCode values insteads of hard-coded values.