Update api.go

Added GetCursor() function.