build getDetailById,fix some bugs