added error checking for undefined or zero length inputs for all route requests