Include <sys/time.h> in api.h
Fixes compiling in some environments that didn't automatically include sys/time.h