Add api call: admin/reset_caches

Extract api functions to a separate file
Set Cache_dir in constants

Change-Id: Id4422ce8778cd0bcd5d78d1c28d6c561bce07a27