fixed most test errors, only need to fix custom routes test