Finish database handlers and modify routes