[#4] Implement endpoints; improve tests