Implemented the backend