This function checks if all necessary input parameters for source and target exist and are valid.
Useful links