add error.h and utils code

add error.h and utils code, schemas code is mainly code