Some api improvements