Fix #1005
Send response before saving to database
Call save rather than return it
Merge pull request #1584 from ThatOtherPerson/log-user-ips

Log last-used IP in User object