Added custom authentication. Refactored away id in items and units. Added some more tests