Made key database key the same as httpkey key format

Also fixed a bug in addDocViaManager