Refactoring: introducing more partial classes to remove #if statements. Also, updating tests based on server change (returning 400 instead of 401).