Add a mock API for testing widgets

Please review after #40