working remotely with firebase js and rest api