fix metaapi state loading, add more comments