Extract an API interface. Implement some idiotic 'tests'. Add HTTP response error handling and translate to exception.