changed jwt library to jsonwebtoken, added expiration
fixing formatting on error check