moved the errors to a single file. Extended the api method