add the init script
fix a bug about memory rest api