api null and type checking

client fixes