do the type checking on API