add api, return proper 404s in the webinterface if stuff goes wrong
add routes for api requests