add spec for create and fix code style

spec:
	test create core functionality
	test error handling