Added GraphicsButton API, refactored to API code