Add an API side to communicate with the frontend side. Fix #6