Added errors and token check and updated server
Fixed syntax error
Updated and fixed errors