Reimplement exceptions to handle status code
Use Datatype for entityType generation