testing validation of registering model to the API and creating custom error