Fix for the local_min_search.py N-state model sample script.
This is similar to the fix of r22926. The return_api() function call was preformed too early.
Instead of placing it after the data pipe creation, the specific analysis type is now directly
specified.