refactor api.go file