Update api.py

Logic error exists in set_password.  Should be using and, nor or.  The normal response here is a 204 (it worked), and or will fail fast when the first condition evaluates to true.