Working on API for frontend communication