Refactored to support ids as long numbers for GAE