added a http example
go fmt
refactoring for a better interface