added update method, fixed tests, changed user api