updated error codes and started implementing library