fixed typo in route and a bug in create function