refactored db models
fixed bugs in the urls