Fixes wrong accept and reject function for orders api. Adds unit test for said functions.