Move duplicated code into shared function
Move duplicated code into shared function

Also, the `POST` calls now return the updated user.

Signed-off-by: Patrick Avery <743342299f279e7a8c3ff5eb40671fce3e95f13a@kitware.com>

OpenChemistry/mongochemserver