putting status of each order in the database rather than return codes
put ehandler in and fix check_exit_