Changed C api

Use pointers instead structs for table parameters and return values.