fix objectId bug, cleanup login, convert everything to typescript