Implemented some lua APIs