Created an api endpoint to upload and serve images