fix some bugs with checking in api