Fixing testing of post requests and invalid requests