Server: add app table, better error handling