Check for parameters first to ensure request is valid