Some api fixes