Refactors tests for handling invalid requests and adds new tests for the execute pipeline API endpoint