Refactoring in tests, proper post request routing