Generalize model parameter sanity check. Add more REST API test cases.