Added changes to make api work regardless of its relative path