Server side functionality done (except the file storage part)