Rest api improvements