Redesign http interface with optional callback