Fix issues 43 - error 500 on /api/sync