Updated and cleaned up Buy Button and Template APIs